Re: [PATCH] fs: fix undefined behavior in bit shift for SB_NOUSER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 29, 2022 at 03:17:45PM +0800, Gaosheng Cui wrote:
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1396,7 +1396,7 @@ extern int send_sigurg(struct fown_struct *fown);
>  #define SB_NOSEC	(1<<28)
>  #define SB_BORN		(1<<29)
>  #define SB_ACTIVE	(1<<30)
> -#define SB_NOUSER	(1<<31)
> +#define SB_NOUSER	(1U<<31)

Let's mark all of the flags as unsigned instead of just one so that
we don't mix types.  s_flags is already unsigned (although for some
reason long) already.

And while you touch this please add the proper whitespaces around the
shift operator everywhere.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux