Skip to content

Commit f902b21

Browse files
jankaratytso
authored andcommitted
ext4: fix bogus warning in ext4_update_dx_flag()
The idea of the warning in ext4_update_dx_flag() is that we should warn when we are clearing EXT4_INODE_INDEX on a filesystem with metadata checksums enabled since after clearing the flag, checksums for internal htree nodes will become invalid. So there's no need to warn (or actually do anything) when EXT4_INODE_INDEX is not set. Link: https://lore.kernel.org/r/20201118153032.17281-1-jack@suse.cz Fixes: 48a3431 ("ext4: fix checksum errors with indexed dirs") Reported-by: Eric Biggers <ebiggers@kernel.org> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org
1 parent 2bf31d9 commit f902b21

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/ext4/ext4.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,8 @@ void ext4_insert_dentry(struct inode *inode,
26952695
struct ext4_filename *fname);
26962696
static inline void ext4_update_dx_flag(struct inode *inode)
26972697
{
2698-
if (!ext4_has_feature_dir_index(inode->i_sb)) {
2698+
if (!ext4_has_feature_dir_index(inode->i_sb) &&
2699+
ext4_test_inode_flag(inode, EXT4_INODE_INDEX)) {
26992700
/* ext4_iget() should have caught this... */
27002701
WARN_ON_ONCE(ext4_has_feature_metadata_csum(inode->i_sb));
27012702
ext4_clear_inode_flag(inode, EXT4_INODE_INDEX);

0 commit comments

Comments
 (0)