]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zoned: fix mounting with conventional zones
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Mon, 5 Sep 2022 12:38:24 +0000 (05:38 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Sep 2022 13:39:10 +0000 (15:39 +0200)
commitcb88107102244e73e729f21ad8fbccf938ee7190
tree2d35bc5c49fed7f44bf88e51198af61d5e89c4ad
parentb294b1234163ddf697a28cc60d283879df27b1c1
btrfs: zoned: fix mounting with conventional zones

Since commit e53a91861972 ("btrfs: zoned: introduce
space_info->active_total_bytes"), we're only counting the bytes of a
block group on an active zone as usable for metadata writes. But on a
SMR drive, we don't have active zones and short circuit some of the
logic.

This leads to an error on mount, because we cannot reserve space for
metadata writes.

Fix this by also setting the BLOCK_GROUP_FLAG_ZONE_IS_ACTIVE bit in the
block-group's runtime flag if the zone is a conventional zone.

Fixes: e53a91861972 ("btrfs: zoned: introduce space_info->active_total_bytes")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zoned.c