Skip to contentSkip to conversation

ext4: return EFSBADCRC if a bad checksum error is found in ext4_find_entry()

PATCH New Theodore Ts'o 1 participant 1 message Jun 23, 2017 ext4 file system

lore
Share & tools
lore

Theodore Ts'o

author maintainer
#0 lore raw

PATCH 1/1 ext4: return EFSBADCRC if a bad checksum error is found in ext4_find_entry()

Previously a bad directory block with a bad checksum is skipped; we should be returning EFSBADCRC (aka EBADMSG).

---
 fs/ext4/namei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/namei.c +2 -1
index 2a7f2dc7f4dd..13f0cadb1238 100644
@@ -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,
Signature · 1 line
2.11.0.rc0.7.gbe5a750