lkml.org 
[lkml]   [2020]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 7/8] fs/ext4: Only change S_DAX on inode load
On Mon 13-04-20 21:00:29, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> To prevent complications with in memory inodes we only set S_DAX on
> inode load. FS_XFLAG_DAX can be changed at any time and S_DAX will
> change after inode eviction and reload.
>
> Add init bool to ext4_set_inode_flags() to indicate if the inode is
> being newly initialized.
>
> Assert that S_DAX is not set on an inode which is just being loaded.

> @@ -4408,11 +4408,13 @@ static bool ext4_enable_dax(struct inode *inode)
> return (flags & EXT4_DAX_FL) == EXT4_DAX_FL;
> }
>
> -void ext4_set_inode_flags(struct inode *inode)
> +void ext4_set_inode_flags(struct inode *inode, bool init)
> {
> unsigned int flags = EXT4_I(inode)->i_flags;
> unsigned int new_fl = 0;
>
> + J_ASSERT(!(IS_DAX(inode) && init));
> +

WARN_ON or BUG_ON here? J_ASSERT is for journalling assertions...

Otherwise the patch looks good.

Honza

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

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