lkml.org 
[lkml]   [2020]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 7/8] fs/ext4: Introduce DAX inode flag
On Tue 19-05-20 22:57:52, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> Add a flag to preserve FS_XFLAG_DAX in the ext4 inode.
>
> Set the flag to be user visible and changeable. Set the flag to be
> inherited. Allow applications to change the flag at any time with the
> exception of if VERITY or ENCRYPT is set.
>
> Disallow setting VERITY or ENCRYPT if DAX is set.
>
> Finally, on regular files, flag the inode to not be cached to facilitate
> changing S_DAX on the next creation of the inode.
>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

The patch looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

One comment below:

> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 5ba65eb0e2ef..be9713e898eb 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1323,6 +1323,9 @@ static int ext4_set_context(struct inode *inode, const void *ctx, size_t len,
> if (WARN_ON_ONCE(IS_DAX(inode) && i_size_read(inode)))
> return -EINVAL;

AFAIU this check is here so that fscrypt_inherit_context() is able call us
and we can clear S_DAX flag. So can't we rather move this below the
EXT4_INODE_DAX check and change this to

IS_DAX(inode) && !(inode->i_flags & I_NEW)

? Because as I'm reading the code now, this should never trigger?

>
> + if (ext4_test_inode_flag(inode, EXT4_INODE_DAX))
> + return -EOPNOTSUPP;
> +

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2020-05-20 16:12    [W:1.724 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site