Skip to content

Commit

Permalink
btrfs: reset max_extent_size on clear in a bitmap
Browse files Browse the repository at this point in the history
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: stable@vger.kernel.org # 4.4+
Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Josef Bacik authored and Greg Kroah-Hartman committed Nov 13, 2018
1 parent c160dae commit 9ff40fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,8 @@ static inline void __bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
bitmap_clear(info->bitmap, start, count);

info->bytes -= bytes;
if (info->max_extent_size > ctl->unit)
info->max_extent_size = 0;
}

static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
Expand Down

0 comments on commit 9ff40fb

Please sign in to comment.