From 00f03e5b5ce3cbc4e202402099275793ddee5c23 Mon Sep 17 00:00:00 2001 From: "Theodore Y. Ts'o" Date: Tue, 10 Jul 2018 15:11:31 -0700 Subject: [PATCH] UBUNTU: SAUCE: ext4: fix ext4_validate_inode_bitmap: comm stress-ng: Corrupt inode bitmap BugLink: http://bugs.launchpad.net/bugs/1780137 Fix regression triggered by the stress-ng[*] "chdir" test, with LKML test patch. Regression observed on some arm64 server platforms: EXT4-fs error (device sda1): ext4_validate_inode_bitmap:99: comm stress-ng: Corrupt inode bitmap Reference: https://lkml.org/lkml/2018/7/7/2 Reported-by: dann frazier Tested-by: dann frazier Fixes: 044e6e3d74a3 ext4: don't update checksum of new initialized bitmaps Signed-off-by: Kamal Mostafa Acked-by: Khalid Elmously Acked-by: Colin Ian King Signed-off-by: Khalid Elmously --- fs/ext4/ialloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 8bd0759a88e6..6e0804d78633 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -91,6 +91,8 @@ static int ext4_validate_inode_bitmap(struct super_block *sb, return -EFSCORRUPTED; ext4_lock_group(sb, block_group); + if (buffer_verified(bh)) + goto verified; blk = ext4_inode_bitmap(sb, desc); if (!ext4_inode_bitmap_csum_verify(sb, block_group, desc, bh, EXT4_INODES_PER_GROUP(sb) / 8)) { @@ -108,6 +110,7 @@ static int ext4_validate_inode_bitmap(struct super_block *sb, return -EFSBADCRC; } set_buffer_verified(bh); +verified: ext4_unlock_group(sb, block_group); return 0; } -- 2.39.2