Skip to content

Commit 9aabbb2

Browse files
Josef Bacikgregkh
authored andcommitted
btrfs: reset max_extent_size on clear in a bitmap
commit 553cceb upstream. We need to clear the max_extent_size when we clear bits from a bitmap since it could have been from the range that contains the max_extent_size. CC: [email protected] # 4.4+ Reviewed-by: Liu Bo <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9006ad1 commit 9aabbb2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/free-space-cache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,8 @@ static inline void __bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
16871687
bitmap_clear(info->bitmap, start, count);
16881688

16891689
info->bytes -= bytes;
1690+
if (info->max_extent_size > ctl->unit)
1691+
info->max_extent_size = 0;
16901692
}
16911693

16921694
static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,

0 commit comments

Comments
 (0)