]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 08:47:16 +0000 (10:47 +0200)
commit56fd5dcf111be825b404b51a04ca807945411295
tree6710a49520e09abaab53ba4a261d45a4f3c6908b
parent7b4cc3e4b28a88888025de5933ded7bee4c44c5d
btrfs: zoned: fix mounting with conventional zones

[ Upstream commit 6ca64ac2763149fb66c0b4bf12f5e0977a88e51d ]

Since commit 6a921de58992 ("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: 6a921de58992 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/zoned.c