]> git.hungrycats.org Git - linux/commit
ext4: fix online resize with a non-standard blocks per group setting
authorTheodore Ts'o <tytso@mit.edu>
Sun, 16 Feb 2014 03:42:25 +0000 (22:42 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 06:06:07 +0000 (22:06 -0800)
commitfe01b1a2d49c4a43ab556a1f0f35b8582ca62ac5
tree9e36c9c84a821db11e8747e5c3739aa4b1a9e6f2
parent385d7ce181827add6cf1a4b1944765f34e9125be
ext4: fix online resize with a non-standard blocks per group setting

commit 3d2660d0c9c2f296837078c189b68a47f6b2e3b5 upstream.

The set_flexbg_block_bitmap() function assumed that the number of
blocks in a blockgroup was sb->blocksize * 8, which is normally true,
but not always!  Use EXT4_BLOCKS_PER_GROUP(sb) instead, to fix block
bitmap corruption after:

mke2fs -t ext4 -g 3072 -i 4096 /dev/vdd 1G
mount -t ext4 /dev/vdd /vdd
resize2fs /dev/vdd 8G

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Jon Bernard <jbernard@tuxion.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/resize.c