]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: fix check to prevent false positive report of incorrect used inodes
authorZhang Yi <yi.zhang@huawei.com>
Wed, 31 Mar 2021 12:15:16 +0000 (20:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:38:19 +0000 (10:38 +0200)
commit539ba4ebc467260225898e67ea53cbb73308f894
treeb666487c187201750e0af20e163b5d85b410fe98
parent24cd31752f47699b89b4b3471155c8e599a1a23a
ext4: fix check to prevent false positive report of incorrect used inodes

commit a149d2a5cabbf6507a7832a1c4fd2593c55fd450 upstream.

Commit <50122847007> ("ext4: fix check to prevent initializing reserved
inodes") check the block group zero and prevent initializing reserved
inodes. But in some special cases, the reserved inode may not all belong
to the group zero, it may exist into the second group if we format
filesystem below.

  mkfs.ext4 -b 4096 -g 8192 -N 1024 -I 4096 /dev/sda

So, it will end up triggering a false positive report of a corrupted
file system. This patch fix it by avoid check reserved inodes if no free
inode blocks will be zeroed.

Cc: stable@kernel.org
Fixes: 50122847007 ("ext4: fix check to prevent initializing reserved inodes")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Suggested-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20210331121516.2243099-1-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/ialloc.c