summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2017-07-25 16:54:41 -0400
committerDavid Sterba <dsterba@suse.com>2017-08-24 19:07:18 +0200
commit77083770759166dd42f1cc17f173148b51ae7d28 (patch)
treec944240f2e5ebaf2b43aa933024145c64bb9db47 /disk-io.c
parent960870cc57999d6b432a214d771edf440eb81f3d (diff)
btrfs-progs: convert: properly handle reserved ranges while iterating files
Commit 522ef705e38 (btrfs-progs: convert: Introduce function to calculate the available space) changed how we handle migrating file data so that we never have btrfs space associated with the reserved ranges. This works pretty well and when we iterate over the file blocks, the associations are redirected to the migrated locations. This commit missed the case in block_iterate_proc where we just check for intersection with a superblock location before looking up a block group. intersect_with_sb checks to see if the range intersects with a stripe containing a superblock but, in fact, we've reserved the full 0-1MB range at the start of the disk. So a file block located at e.g. 160kB will fall in the reserved region but won't be excepted in block_iterate_block. We ultimately hit a BUG_ON when we fail to look up the block group for that location. This is reproducible using convert-tests/003-ext4-basic. The fix is to have intersect_with_sb and block_iterate_proc understand the full size of the reserved ranges. Since we use the range to determine the boundary for the block iterator, let's just return the boundary. 0 isn't a valid boundary and means that we proceed normally with block group lookup. Cc: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: Jeff Mahoney <jeffm@suse.com> Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'disk-io.c')
0 files changed, 0 insertions, 0 deletions