]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ext4: return EFSBADCRC if a bad checksum error is found in ext4_find_entry()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 23 Jun 2017 04:47:05 +0000 (00:47 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 23 Jun 2017 04:47:05 +0000 (00:47 -0400)
Previously a bad directory block with a bad checksum is skipped; we
should be returning EFSBADCRC (aka EBADMSG).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c

index 2a7f2dc7f4dd06d1820c2e5a56f70c897966a0dd..13f0cadb1238e61983629e02cda233a60b84f6d1 100644 (file)
@@ -1456,7 +1456,8 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
                        EXT4_ERROR_INODE(dir, "checksumming directory "
                                         "block %lu", (unsigned long)block);
                        brelse(bh);
-                       goto next;
+                       ret = ERR_PTR(-EFSBADCRC);
+                       goto cleanup_and_exit;
                }
                set_buffer_verified(bh);
                i = search_dirblock(bh, dir, &fname,