]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: zoned: fixup last alloc pointer after extent removal for RAID1
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 17 Dec 2025 11:14:04 +0000 (20:14 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:56:23 +0000 (07:56 +0100)
commitdda3ec9ee6b3e120603bff1b798f25b51e54ac5d
treeef2db9d2e24fc01320458d5d6667cbb5617fb4ba
parent3f8982543dae28159cec5fad33c1b3f5cd12314b
btrfs: zoned: fixup last alloc pointer after extent removal for RAID1

When a block group is composed of a sequential write zone and a
conventional zone, we recover the (pseudo) write pointer of the
conventional zone using the end of the last allocated position.

However, if the last extent in a block group is removed, the last extent
position will be smaller than the other real write pointer position.
Then, that will cause an error due to mismatch of the write pointers.

We can fixup this case by moving the alloc_offset to the corresponding
write pointer position.

Fixes: 568220fa9657 ("btrfs: zoned: support RAID0/1/10 on top of raid stripe tree")
CC: stable@vger.kernel.org # 6.12+
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