]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: eliminate bogus error in ext4_data_block_valid_rcu()
authorTahsin Erdogan <trdgn@amazon.com>
Sat, 3 Jul 2021 23:05:55 +0000 (16:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jul 2021 10:49:30 +0000 (12:49 +0200)
commit6a6e04ce3bafb24a346a64e9766ec37814036245
tree2665413e353bb7fd33eee38d975cdf18b42933c3
parent6dcca74b358a849c55ab2db41ae8f97e08ffb8e0
ext4: eliminate bogus error in ext4_data_block_valid_rcu()

Mainline commit ce9f24cccdc0 ("ext4: check journal inode extents more carefully")
enabled validity checks for journal inode's data blocks. This change got
ported to stable branches, but the backport for 4.19 has a bug where it will
flag an error even when system block entry's inode number matches journal
inode.

The way error is reported is also problematic because it updates the superblock
without following journaling rules. This may result in superblock checksum
errors if the superblock is in the process of being committed but has a
previously calculated checksum that doesn't include the bogus error update.

This patch eliminates the bogus error by trying to match how other backports
were implemented, which is to flag an error only when inode numbers mismatch.

Fixes: commit a75a5d163857 ("ext4: check journal inode extents more carefully")
Signed-off-by: Tahsin Erdogan <trdgn@amazon.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/block_validity.c