]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext4: fix false negatives *and* false positives in ext4_check_descriptors()
authorShuning Zhang <sunny.s.zhang@oracle.com>
Wed, 29 May 2019 07:41:35 +0000 (15:41 +0800)
committerBrian Maly <brian.maly@oracle.com>
Mon, 3 Jun 2019 16:34:27 +0000 (12:34 -0400)
commit01f5ac086b9b4b0a77e387ab97643f7c5bf7725e
treee5d6188fd20527cfd5070e2e586f6be5d508ce97
parent5bba819d55b126cd6af12a722f0f192dcbdf7b0c
ext4: fix false negatives *and* false positives in ext4_check_descriptors()

Ext4_check_descriptors() was getting called before s_gdb_count was
initialized.  So for file systems w/o the meta_bg feature, allocation
bitmaps could overlap the block group descriptors and ext4 wouldn't
notice.

For file systems with the meta_bg feature enabled, there was a
fencepost error which would cause the ext4_check_descriptors() to
incorrectly believe that the block allocation bitmap overlaps with the
block group descriptor blocks, and it would reject the mount.

Fix both of these problems.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
(cherry picked from commit 44de022c4382541cebdd6de4465d1f4f465ff1dd)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
    fs/ext4/super.c
    [The contextual has been changed]

Orabug: 29797007

Signed-off-by: Shuning Zhang <sunny.s.zhang@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
fs/ext4/super.c