Skip to content

Commit 79417d0

Browse files
naotakdave
authored andcommitted
btrfs: zoned: disable metadata overcommit for zoned
The metadata overcommit makes the space reservation flexible but it is also harmful to active zone tracking. Since we cannot finish a block group from the metadata allocation context, we might not activate a new block group and might not be able to actually write out the overcommit reservations. So, disable metadata overcommit for zoned filesystems. We will ensure the reservations are under active_total_bytes in the following patches. CC: stable@vger.kernel.org # 5.16+ Fixes: afba2bc ("btrfs: zoned: implement active zone tracking") Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 6a921de commit 79417d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/btrfs/space-info.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ int btrfs_can_overcommit(struct btrfs_fs_info *fs_info,
399399
return 0;
400400

401401
used = btrfs_space_info_used(space_info, true);
402-
avail = calc_available_free_space(fs_info, space_info, flush);
402+
if (btrfs_is_zoned(fs_info) && (space_info->flags & BTRFS_BLOCK_GROUP_METADATA))
403+
avail = 0;
404+
else
405+
avail = calc_available_free_space(fs_info, space_info, flush);
403406

404407
if (used + bytes < writable_total_bytes(fs_info, space_info) + avail)
405408
return 1;

0 commit comments

Comments
 (0)