From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "frank.li@vivo.com" <frank.li@vivo.com>,
"glaubitz@physik.fu-berlin.de" <glaubitz@physik.fu-berlin.de>,
"penguin-kernel@I-love.SAKURA.ne.jp"
<penguin-kernel@I-love.SAKURA.ne.jp>,
"slava@dubeyko.com" <slava@dubeyko.com>,
"brauner@kernel.org" <brauner@kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] hfsplus: don't use BUG_ON() in hfsplus_create_attributes_file()
Date: Mon, 7 Jul 2025 19:03:18 +0000 [thread overview]
Message-ID: <127b250a6bb701c631bedf562b3ee71eeb55dc2c.camel@ibm.com> (raw)
In-Reply-To: <427a9432-95a5-47a8-ba42-1631c6238486@I-love.SAKURA.ne.jp>
On Mon, 2025-07-07 at 23:45 +0900, Tetsuo Handa wrote:
> On 2025/07/07 23:22, Yangtao Li wrote:
> > 161 case HFSPLUS_VALID_ATTR_TREE:
> > 162 return 0;
> > 163 case HFSPLUS_FAILED_ATTR_TREE:
> > 164 return -EOPNOTSUPP;
> > 165 default:
> > 166 BUG();
> > 167 }
> >
> > I haven't delved into the implementation details of xattr yet, but
> > there is a bug in this function. It seems that we should convert
> > the bug to return EIO in another patch?
>
> I don't think this BUG() is triggerable. attr_tree_state is an atomic_t
> which can take only one of HFSPLUS_EMPTY_ATTR_TREE, HFSPLUS_VALID_ATTR_TREE,
> HFSPLUS_FAILED_ATTR_TREE or HFSPLUS_CREATING_ATTR_TREE.
It's completely correct conclusion. The goal of this BUG() simply to trigger the
crash if somebody will change the set of possible states of attr_tree_state. But
this logic will not be reworked.
>> @@ -172,7 +172,11 @@ static int hfsplus_create_attributes_file(struct
super_block *sb)
>> return PTR_ERR(attr_file);
>> }
>>
>> - BUG_ON(i_size_read(attr_file) != 0);
But I still worry about i_size_read(attr_file). How this size could be not zero
during hfsplus_create_attributes_file() call?
Thanks,
Slava.
next prev parent reply other threads:[~2025-07-07 19:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 10:10 [PATCH] hfsplus: don't use BUG_ON() in hfsplus_create_attributes_file() Tetsuo Handa
2025-06-30 17:18 ` Viacheslav Dubeyko
2025-07-07 14:22 ` Yangtao Li
2025-07-07 14:45 ` Tetsuo Handa
2025-07-07 19:03 ` Viacheslav Dubeyko [this message]
2025-07-09 14:02 ` Tetsuo Handa
2025-07-09 18:33 ` Viacheslav Dubeyko
2025-07-09 22:03 ` Tetsuo Handa
2025-07-11 11:35 ` Tetsuo Handa
2025-07-11 17:21 ` Viacheslav Dubeyko
2025-07-12 11:22 ` Tetsuo Handa
2025-07-14 23:30 ` Viacheslav Dubeyko
2025-07-15 5:17 ` [PATCH v2] " Tetsuo Handa
2025-07-15 18:49 ` Viacheslav Dubeyko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=127b250a6bb701c631bedf562b3ee71eeb55dc2c.camel@ibm.com \
--to=slava.dubeyko@ibm.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=frank.li@vivo.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=slava@dubeyko.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).