From: cuigaosheng <cuigaosheng1@huawei.com>
To: Matthew Wilcox <willy@infradead.org>,
Christoph Hellwig <hch@infradead.org>
Cc: <viro@zeniv.linux.org.uk>, <linux-fsdevel@vger.kernel.org>,
<dhowells@redhat.com>
Subject: Re: [PATCH v2] fs: fix undefined behavior in bit shift for SB_NOUSER
Date: Mon, 31 Oct 2022 22:36:19 +0800 [thread overview]
Message-ID: <3dcc91f9-48ef-5874-955a-dd5e1492a648@huawei.com> (raw)
In-Reply-To: <Y1/TWdY//yUgXGck@casper.infradead.org>
> Shouldn't those ^^^ also be marked as unsigned? And it's confusing to
> have the style change halfway through the sequence; can you convert them
> to (1U << n) as well?
Thanks, I have made a patch v3 and submit it, but I'm not sure should I
add "Reviewed-by: Christoph Hellwig<hch@lst.de>" because the code has been
changed,Thank you all again!
On 2022/10/31 21:53, Matthew Wilcox wrote:
> On Mon, Oct 31, 2022 at 09:48:11PM +0800, Gaosheng Cui wrote:
>> +++ b/include/linux/fs.h
>> @@ -1384,19 +1384,19 @@ extern int send_sigurg(struct fown_struct *fown);
>> #define SB_NOATIME 1024 /* Do not update access times. */
>> #define SB_NODIRATIME 2048 /* Do not update directory access times */
>> #define SB_SILENT 32768
> Shouldn't those ^^^ also be marked as unsigned? And it's confusing to
> have the style change halfway through the sequence; can you convert them
> to (1U << n) as well?
>
>> -#define SB_POSIXACL (1<<16) /* VFS does not apply the umask */
>> -#define SB_INLINECRYPT (1<<17) /* Use blk-crypto for encrypted files */
>> -#define SB_KERNMOUNT (1<<22) /* this is a kern_mount call */
>> -#define SB_I_VERSION (1<<23) /* Update inode I_version field */
>> -#define SB_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */
>> +#define SB_POSIXACL (1U << 16) /* VFS does not apply the umask */
>> +#define SB_INLINECRYPT (1U << 17) /* Use blk-crypto for encrypted files */
>> +#define SB_KERNMOUNT (1U << 22) /* this is a kern_mount call */
>> +#define SB_I_VERSION (1U << 23) /* Update inode I_version field */
>> +#define SB_LAZYTIME (1U << 25) /* Update the on-disk [acm]times lazily */
>>
>> /* These sb flags are internal to the kernel */
>> -#define SB_SUBMOUNT (1<<26)
>> -#define SB_FORCE (1<<27)
>> -#define SB_NOSEC (1<<28)
>> -#define SB_BORN (1<<29)
>> -#define SB_ACTIVE (1<<30)
>> -#define SB_NOUSER (1<<31)
>> +#define SB_SUBMOUNT (1U << 26)
>> +#define SB_FORCE (1U << 27)
>> +#define SB_NOSEC (1U << 28)
>> +#define SB_BORN (1U << 29)
>> +#define SB_ACTIVE (1U << 30)
>> +#define SB_NOUSER (1U << 31)
>>
>> /* These flags relate to encoding and casefolding */
>> #define SB_ENC_STRICT_MODE_FL (1 << 0)
>> --
>> 2.25.1
>>
> .
next prev parent reply other threads:[~2022-10-31 14:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 13:48 [PATCH v2] fs: fix undefined behavior in bit shift for SB_NOUSER Gaosheng Cui
2022-10-31 13:50 ` Christoph Hellwig
2022-10-31 13:53 ` Matthew Wilcox
2022-10-31 14:05 ` Christoph Hellwig
2022-10-31 14:36 ` cuigaosheng [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-04-24 3:00 [PATCH] " Hao Ge
2023-04-24 4:51 ` [PATCH V2] " Hao Ge
2023-04-24 5:01 ` Al Viro
2023-04-24 5:43 ` Hao Ge
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=3dcc91f9-48ef-5874-955a-dd5e1492a648@huawei.com \
--to=cuigaosheng1@huawei.com \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.