Due to a fencepost bug, when skipping a block group whose block bitmap
was uninitialized (and hence could not contain any blocks eligible for
relaocation), the block immediately following the block group wasn't
checked as well. If it was in use and required relocation, it
wouldn't get properly relocated, with the result that an inode using
such a block would end up, post resize, with a pointer to a block now
outside the bounds of the filesystem.
This commit fixes this fencepost error.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* to the next block group.
*/
blk = ((g+1) * fs->super->s_blocks_per_group) +
- fs->super->s_first_data_block;
+ fs->super->s_first_data_block - 1;
continue;
}
if (ext2fs_test_block_bitmap(old_fs->block_map, blk) &&