Re: [PATCH 1/7] ext4: use IS_ENCRYPTED() to check encryption status

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

 



Hi Chandan,

On Mon, Nov 19, 2018 at 10:53:18AM +0530, Chandan Rajendra wrote:
> @@ -4724,7 +4724,7 @@ static bool ext4_should_use_dax(struct inode *inode)
>  		return false;
>  	if (ext4_has_inline_data(inode))
>  		return false;
> -	if (ext4_encrypted_inode(inode))
> +	if (IS_ENCRYPTED(inode))
>  		return false;
>  	if (ext4_verity_inode(inode))
>  		return false;

I think this part is wrong.  See how ext4_should_use_dax() is called from
ext4_set_inode_flags(), from ext4_set_context().  In this case,
ext4_set_inode_flags() should set S_ENCRYPTED and clear S_DAX.  However, you've
changed ext4_should_use_dax() to check S_ENCRYPTED instead of EXT4_ENCRYPT_FL;
but S_ENCRYPTED isn't set until later in ext4_set_inode_flags(), so S_DAX won't
be cleared anymore.

So I think you need to use ext4_test_inode_flag() here instead.

Similarly for the verity check.

- Eric



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux