]> 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)
commit4145ac1549f51d2616ff1d80db548f2e78b25e0a
tree2d35bc5c49fed7f44bf88e51198af61d5e89c4ad
parentc68c9ca33fa50fb912b5ae015c9e7621bb1fbc00
btrfs: zoned: fix mounting with conventional zones

Since commit c6d979cbe257 ("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: c6d979cbe257 ("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