Btrfs-progs: fix infinite loop in find_free_extent
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 26 Jun 2017 17:34:41 +0000 (11:34 -0600)
committerDavid Sterba <dsterba@suse.com>
Thu, 20 Jul 2017 15:43:43 +0000 (17:43 +0200)
commitd0379cc1d0a34313e7436cdc75e418515f9b03fc
treee397ac9c665e41e0bd133956fae9f409f319b6ea
parent3987fb6f076485e8e63aa279e0d3438084b5dcf4
Btrfs-progs: fix infinite loop in find_free_extent

If the found %ins is crossing a stripe len, ie. BTRFS_STRIPE_LEN, we'd
search again with a stripe-aligned %search_start.  The current code
calculates %search_start by adding a wrong offset, in order to fix it, the
start position of the block group should be taken, otherwise, it'll end up
with looking at the same block group forever.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
extent-tree.c