ext4: fix block bitmap validation when bigalloc, ^flex_bg
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 12 May 2014 14:17:55 +0000 (10:17 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:01 +0000 (00:30 +0100)
commiteea55da54d3e425d6a5f3cfeb3f26adbb0330354
treebe9fa6c0537bdd30813daf956d0cbdcf4af03625
parentbf7fc655f12864b4c12d902cf60ae37a708cc344
ext4: fix block bitmap validation when bigalloc, ^flex_bg

commit e674e5cbd0942b42a12106ac0be8330f4301bef4 upstream.

On a bigalloc,^flex_bg filesystem, the ext4_valid_block_bitmap
function fails to convert from blocks to clusters when spot-checking
the validity of the bitmap block that we've just read from disk.  This
causes ext4 to think that the bitmap is garbage, which results in the
block group being taken offline when it's not necessary.  Add in the
necessary EXT4_B2C() calls to perform the conversions.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/balloc.c