Re: [PATCH 1/7] ext4: use IS_ENCRYPTED() to check encryption status
From: Eric Biggers <ebiggers@kernel.org>
Date: 2018-11-27 11:31:12
Also in:
linux-f2fs-devel, linux-fscrypt
From: Eric Biggers <ebiggers@kernel.org>
Date: 2018-11-27 11:31:12
Also in:
linux-f2fs-devel, linux-fscrypt
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