ext4: Fix bogus warning in ext4_update_dx_flag()
Jan Kara
reviewerPATCH 1/1 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.
--- fs/ext4/ext4.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/ext4.h +2 -1
@@ -2685,7 +2685,8 @@ void ext4_insert_dentry(struct inode *inode, struct ext4_filename *fname);static inline void ext4_update_dx_flag (struct inode *inode) { -if (!ext4_has_feature_dir_index (inode->i_sb)) { +if (!ext4_has_feature_dir_index (inode->i_sb) && +ext4_test_inode_flag (inode,EXT4_INODE_INDEX )) {/* ext4_iget() should have caught this... */ WARN_ON_ONCE (ext4_has_feature_metadata_csum (inode->i_sb));ext4_clear_inode_flag (inode,EXT4_INODE_INDEX );
Signature · 1 line
2.16.4
Quoted 9 lines · Jan Kara
The idea of the warning in
ext4_update_dx_flag()is that we should warn when we are clearingEXT4_INODE_INDEXon 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) whenEXT4_INODE_INDEXis not set.Reported-by Eric Biggers <[email protected]>Fixes 48a34311953d ("ext4: fix checksum errors with indexed dirs")Signed-off-by Jan Kara <[email protected]>
Looks good,
- Eric
Quoted 7 lines · Eric Biggers
Quoted 6 lines · Jan Kara
The idea of the warning in
ext4_update_dx_flag()is that we should warn when we are clearingEXT4_INODE_INDEXon 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) whenEXT4_INODE_INDEXis not set.
Quoted 7 lines
Quoted 3 lines
Reported-by Eric Biggers <[email protected]>Fixes 48a34311953d ("ext4: fix checksum errors with indexed dirs")Signed-off-by Jan Kara <[email protected]>Looks good,
Reviewed-by Eric Biggers <[email protected]>
Applied, thanks.
- Ted