]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: zoned: fix full zone super block reading on ZNS
authorNaohiro Aota <Naohiro.Aota@wdc.com>
Tue, 9 May 2023 18:29:15 +0000 (18:29 +0000)
committerDavid Sterba <dsterba@suse.com>
Wed, 10 May 2023 12:50:22 +0000 (14:50 +0200)
commit02ca9e6fb5f66a031df4fac508b8e477ca69e918
treeb96908056b7856e13a1040a9cb39a9ee7487ee49
parentf84353c7c20536ea7e01eca79430eccdf3cc7348
btrfs: zoned: fix full zone super block reading on ZNS

When both of the superblock zones are full, we need to check which
superblock is newer. The calculation of last superblock position is wrong
as it does not consider zone_capacity and uses the length.

Fixes: 9658b72ef300 ("btrfs: zoned: locate superblock position using zone capacity")
CC: stable@vger.kernel.org # 6.1+
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/zoned.c