[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210716162017.GA22346@magnolia>
Date: Fri, 16 Jul 2021 09:20:17 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: Jeffle Xu <jefflexu@...ux.alibaba.com>
Cc: viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org
Subject: Re: [PATCH] vfs: only allow SETFLAGS to set DAX flag on files and
dirs
On Fri, Jul 16, 2021 at 02:19:51PM +0800, Jeffle Xu wrote:
> This is similar to commit dbc77f31e58b ("vfs: only allow FSSETXATTR to
> set DAX flag on files and dirs").
>
> Though the underlying filesystems may have filtered invalid flags, e.g.,
> ext4_mask_flags() called in ext4_fileattr_set(), also check it in VFS
> layer.
>
> Signed-off-by: Jeffle Xu <jefflexu@...ux.alibaba.com>
> ---
> fs/ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ioctl.c b/fs/ioctl.c
> index 1e2204fa9963..1fe73e148e2d 100644
> --- a/fs/ioctl.c
> +++ b/fs/ioctl.c
> @@ -835,7 +835,7 @@ static int fileattr_set_prepare(struct inode *inode,
> * It is only valid to set the DAX flag on regular files and
> * directories on filesystems.
> */
> - if ((fa->fsx_xflags & FS_XFLAG_DAX) &&
> + if ((fa->fsx_xflags & FS_XFLAG_DAX || fa->flags & FS_DAX_FL) &&
I thought we always had to surround flag tests with separate
parentheses...?
--D
> !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)))
> return -EINVAL;
>
> --
> 2.27.0
>
Powered by blists - more mailing lists