]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zoned: do not account freed region of read-only block group as zone_unusable
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 3 Mar 2021 08:55:48 +0000 (17:55 +0900)
committerDavid Sterba <dsterba@suse.com>
Thu, 4 Mar 2021 15:16:58 +0000 (16:16 +0100)
commit16e5220f9767bc8e966073af9d0aa687df8cd630
tree6b067f50bdc3d6faacead81b56c416da7ef8ebb2
parent12fd2fb98c3a603bbbc3435a9d53d6280b561ec4
btrfs: zoned: do not account freed region of read-only block group as zone_unusable

We migrate zone unusable bytes to read-only bytes when a block group is
set to read-only, and account all the free region as bytes_readonly.
Thus, we should not increase block_group->zone_unusable when the block
group is read-only.

Fixes: be18ded18d80 ("btrfs: zoned: track unusable bytes for zones")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.c