]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/ext4/dir.c
ext4: fix checksum errors with indexed dirs
[mirror_ubuntu-bionic-kernel.git] / fs / ext4 / dir.c
index a242e4e88f41e036aa585a9be9866e8b4756f542..2d0bfc6a75c2309f147d07bac34ed7bc0c273191 100644 (file)
@@ -125,12 +125,14 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
                if (err != ERR_BAD_DX_DIR) {
                        return err;
                }
-               /*
-                * We don't set the inode dirty flag since it's not
-                * critical that it get flushed back to the disk.
-                */
-               ext4_clear_inode_flag(file_inode(file),
-                                     EXT4_INODE_INDEX);
+               /* Can we just clear INDEX flag to ignore htree information? */
+               if (!ext4_has_metadata_csum(sb)) {
+                       /*
+                        * We don't set the inode dirty flag since it's not
+                        * critical that it gets flushed back to the disk.
+                        */
+                       ext4_clear_inode_flag(inode, EXT4_INODE_INDEX);
+               }
        }
 
        if (ext4_has_inline_data(inode)) {