]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zoned: fix comparison of alloc_offset vs meta_write_pointer
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 4 May 2022 23:12:48 +0000 (16:12 -0700)
committerDavid Sterba <dsterba@suse.com>
Tue, 17 May 2022 18:15:25 +0000 (20:15 +0200)
commitd7f350114cdc72f74578fd0a326b1bea1dca3f6e
treedecb2d86c3c0813050d3f0e9dddfc00d92b6da28
parent7e2c7729fac28f84fb2540db66cb1a86a768cdf1
btrfs: zoned: fix comparison of alloc_offset vs meta_write_pointer

The block_group->alloc_offset is an offset from the start of the block
group. OTOH, the ->meta_write_pointer is an address in the logical
space. So, we should compare the alloc_offset shifted with the
block_group->start.

Fixes: 99777e1aeef4 ("btrfs: zoned: implement active zone tracking")
CC: stable@vger.kernel.org # 5.16+
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zoned.c