diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 2cee5ddc7fae90955df0c902440e6ae5219d4f3a..82450978d00ddc9fc2ca9941647e2fe3fbf80461 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1687,6 +1687,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,