ext4: fix off-by-one fsmap error on 1k block filesystems
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 23 Jun 2017 04:58:57 +0000 (00:58 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 23 Jun 2017 04:58:57 +0000 (00:58 -0400)
commit4a4956249dac0b9b0027949907bff0cd1a9b57fa
tree21a8a934c009172ce55d29c97679462dbf2986e2
parentbdddf342796765a1a946e7c4aed2574f4488e4e5
ext4: fix off-by-one fsmap error on 1k block filesystems

For 1k-block filesystems, the filesystem starts at block 1, not block 0.
This fact is recorded in s_first_data_block, so use that to bump up the
start_fsb before we start querying the filesystem for its space map.
Without this, ext4/026 fails on 1k block ext4 because various functions
(notably ext4_get_group_no_and_offset) don't know what to do with an
fsblock that is "before" the start of the filesystem and return garbage
results (blockgroup 2^32-1, etc.) that confuse fsmap.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/fsmap.c