linux/fs/btrfs
Naohiro Aota 5ec1d82f00 btrfs: zoned: fixup last alloc pointer after extent removal for RAID0/10
[ Upstream commit 52ee9965d0 ]

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: 568220fa96 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-12 07:09:31 -04:00
..
tests btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
accessors.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
accessors.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
acl.c btrfs: remove unused included headers 2024-03-04 16:24:46 +01:00
acl.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
async-thread.c btrfs: use list_first_entry() everywhere 2025-05-15 14:30:47 +02:00
async-thread.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
backref.c btrfs: add unlikely annotations to branches leading to EIO 2025-09-23 08:49:26 +02:00
backref.h btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
bio.c btrfs: zoned: don't zone append to conventional zone 2026-02-26 14:58:59 -08:00
bio.h btrfs: zoned: don't zone append to conventional zone 2026-02-26 14:58:59 -08:00
block-group.c btrfs: fix periodic reclaim condition 2026-03-04 07:21:21 -05:00
block-group.h btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
block-rsv.c btrfs: use the correct type to initialize block reserve for delayed refs 2026-02-26 14:59:44 -08:00
block-rsv.h btrfs: add block reserve for treelog 2025-05-15 14:30:53 +02:00
btrfs_inode.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
compression.c btrfs: remove btrfs_bio::fs_info by extracting it from btrfs_bio::inode 2026-02-26 14:58:58 -08:00
compression.h btrfs: remove btrfs_bio::fs_info by extracting it from btrfs_bio::inode 2026-02-26 14:58:58 -08:00
ctree.c btrfs: fix leaf leak in an error path in btrfs_del_items() 2025-12-18 14:03:16 +01:00
ctree.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
defrag.c btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
defrag.h btrfs: pass struct btrfs_inode to btrfs_defrag_file() 2025-03-18 20:35:43 +01:00
delalloc-space.c btrfs: add block reserve for treelog 2025-05-15 14:30:53 +02:00
delalloc-space.h btrfs: pass struct btrfs_inode to btrfs_free_reserved_data_space_noquota() 2025-05-15 14:30:52 +02:00
delayed-inode.c btrfs: fix error message order of parameters in btrfs_delete_delayed_dir_index() 2026-03-12 07:09:19 -04:00
delayed-inode.h btrfs: fix delayed_node ref_tracker use after free 2025-10-22 09:40:04 +02:00
delayed-ref.c btrfs: fix double free of qgroup record after failure to add delayed ref head 2025-12-18 14:03:16 +01:00
delayed-ref.h btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
dev-replace.c btrfs: add unlikely annotations to branches leading to EIO 2025-09-23 08:49:26 +02:00
dev-replace.h btrfs: trivial conversion to return bool instead of int 2025-05-15 14:30:49 +02:00
dir-item.c btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
dir-item.h btrfs: rename inode number parameter passed to btrfs_check_dir_item_collision() 2025-07-22 00:05:00 +02:00
direct-io.c btrfs: fallback to buffered IO if the data profile has duplication 2026-03-04 07:19:31 -05:00
direct-io.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
discard.c btrfs: use verbose assert at peek_discard_list() 2025-05-15 14:30:55 +02:00
discard.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
disk-io.c btrfs: fix compat mask in error messages in btrfs_check_features() 2026-03-12 07:09:20 -04:00
disk-io.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
export.c btrfs: avoid potential out-of-bounds in btrfs_encode_fh() 2025-09-26 08:48:30 +02:00
export.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
extent-io-tree.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
extent-io-tree.h btrfs: convert several int parameters to bool 2025-09-22 10:54:32 +02:00
extent-tree.c btrfs: continue trimming remaining devices on failure 2026-03-04 07:21:22 -05:00
extent-tree.h btrfs: convert several int parameters to bool 2025-09-22 10:54:32 +02:00
extent_io.c btrfs: remove btrfs_bio::fs_info by extracting it from btrfs_bio::inode 2026-02-26 14:58:58 -08:00
extent_io.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
extent_map.c for-6.18-tag 2025-09-30 08:14:49 -07:00
extent_map.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
fiemap.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
fiemap.h btrfs: move fiemap code into its own file 2024-07-11 15:33:20 +02:00
file-item.c btrfs: introduce btrfs_bio::async_csum 2026-02-26 14:58:59 -08:00
file-item.h btrfs: introduce btrfs_bio::async_csum 2026-02-26 14:58:59 -08:00
file.c btrfs: fix changeset leak on mmap write after failure to reserve metadata 2026-01-02 12:56:37 +01:00
file.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
free-space-cache.c btrfs: add unlikely annotations to branches leading to transaction abort 2025-09-23 08:49:26 +02:00
free-space-cache.h btrfs: add cancellation points to trim loops 2024-10-07 23:21:56 +02:00
free-space-tree.c btrfs: do not assert we found block group item when creating free space tree 2025-10-13 22:33:22 +02:00
free-space-tree.h btrfs: add btrfs prefix to free space tree exported functions 2025-07-21 23:58:02 +02:00
fs.c btrfs: enable experimental bs > ps support 2025-09-23 08:49:25 +02:00
fs.h btrfs: reject new transactions if the fs is fully read-only 2026-02-11 13:41:53 +01:00
inode-item.c btrfs: add unlikely annotations to branches leading to transaction abort 2025-09-23 08:49:26 +02:00
inode-item.h btrfs: remove unused parameters from btrfs_lookup_inode_extref() 2025-07-21 23:58:03 +02:00
inode.c btrfs: print correct subvol num if active swapfile prevents deletion 2026-03-12 07:09:20 -04:00
ioctl.c btrfs: free pages on error in btrfs_uring_read_extent() 2026-03-12 07:09:19 -04:00
ioctl.h tree-wide: s/struct fileattr/struct file_kattr/g 2025-07-04 16:14:39 +02:00
Kconfig btrfs: implement ref_tracker for delayed_nodes 2025-09-22 10:54:32 +02:00
locking.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
locking.h btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
lru_cache.c btrfs: fix typos found by codespell 2023-12-15 23:00:04 +01:00
lru_cache.h btrfs: cleanup recursive include of the same header 2024-07-11 15:33:22 +02:00
lzo.c btrfs: add unlikely annotations to branches leading to EUCLEAN 2025-09-23 08:49:26 +02:00
Makefile btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
messages.c btrfs: dump detailed info and specific messages on log replay failures 2025-09-23 08:49:21 +02:00
messages.h btrfs: remove duplicate inclusion of linux/types.h 2025-09-22 10:54:31 +02:00
misc.h btrfs: define the AUTO_KFREE/AUTO_KVFREE helper macros 2026-03-12 07:09:31 -04:00
ordered-data.c btrfs: truncate ordered extent when skipping writeback past i_size 2026-01-17 16:35:30 +01:00
ordered-data.h btrfs: introduce a read path dedicated extent lock helper 2025-03-18 20:35:48 +01:00
orphan.c btrfs: BTRFS_PATH_AUTO_FREE in orphan.c 2024-09-10 16:51:22 +02:00
orphan.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
print-tree.c btrfs: print-tree: print key types as human readable strings 2025-09-23 08:49:23 +02:00
print-tree.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
props.c btrfs: props: switch prop_handler::extract to struct btrfs_inode 2025-03-18 20:35:44 +01:00
props.h btrfs: pass struct btrfs_inode to btrfs_inode_inherit_props() 2025-03-18 20:35:44 +01:00
qgroup.c btrfs: fix invalid leaf access in btrfs_quota_enable() if ref key not found 2026-02-26 14:59:44 -08:00
qgroup.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
raid-stripe-tree.c btrfs: add unlikely annotations to branches leading to transaction abort 2025-09-23 08:49:26 +02:00
raid-stripe-tree.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
raid56.c btrfs: add unlikely annotations to branches leading to EIO 2025-09-23 08:49:26 +02:00
raid56.h btrfs: prepare scrub to support bs > ps cases 2025-09-23 08:49:25 +02:00
ref-verify.c btrfs: ref-verify: fix IS_ERR() vs NULL check in btrfs_build_ref_tree() 2025-10-22 09:40:07 +02:00
ref-verify.h btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
reflink.c btrfs: add unlikely annotations to branches leading to transaction abort 2025-09-23 08:49:26 +02:00
reflink.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
relocation.c btrfs: fix clearing of BTRFS_FS_RELOC_RUNNING if relocation already running 2025-10-13 22:29:03 +02:00
relocation.h btrfs: don't print relocation messages from auto reclaim 2025-07-22 00:09:22 +02:00
root-tree.c btrfs: add unlikely annotations to branches leading to transaction abort 2025-09-23 08:49:26 +02:00
root-tree.h btrfs: qgroup: fix qgroup prealloc rsv leak in subvolume operations 2024-04-02 19:18:23 +02:00
scrub.c btrfs: fix warning in scrub_verify_one_metadata() 2026-03-12 07:09:20 -04:00
scrub.h btrfs: convert several int parameters to bool 2025-09-22 10:54:32 +02:00
send.c btrfs: send: check for inline extents in range_is_hole_in_parent() 2026-01-23 11:21:15 +01:00
send.h btrfs: pass btrfs_root pointers to send ioctl parameters 2025-03-18 20:35:49 +01:00
space-info.c btrfs: fix periodic reclaim condition 2026-03-04 07:21:21 -05:00
space-info.h btrfs: remove fs_info argument from btrfs_try_granting_tickets() 2026-02-26 14:59:44 -08:00
subpage.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
subpage.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
super.c btrfs: only enforce free space tree if v1 cache is required for bs < ps cases 2026-01-17 16:35:25 +01:00
super.h btrfs: change BTRFS_MOUNT_* flags to 64bit type 2024-07-19 17:20:23 +02:00
sysfs.c btrfs: simplify support block size check 2025-09-22 10:54:31 +02:00
sysfs.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
transaction.c btrfs: use the correct type to initialize block reserve for delayed refs 2026-02-26 14:59:44 -08:00
transaction.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
tree-checker.c btrfs: fix objectid value in error message in check_extent_data_ref() 2026-03-12 07:09:20 -04:00
tree-checker.h btrfs: validate system chunk array at btrfs_validate_super() 2025-01-13 14:53:18 +01:00
tree-log.c btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
tree-log.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
tree-mod-log.c btrfs: reduce size of struct tree_mod_elem 2025-07-22 00:09:20 +02:00
tree-mod-log.h btrfs: drop unused parameter path from btrfs_tree_mod_log_rewind() 2024-11-11 14:34:15 +01:00
ulist.c btrfs: use rb_find_add() in ulist_rbtree_insert() 2025-07-21 23:53:25 +02:00
ulist.h btrfs: preallocate ulist memory for qgroup rsv 2024-07-11 15:33:26 +02:00
uuid-tree.c btrfs: uuid-tree: remove unnecessary call to btrfs_mark_buffer_dirty() 2025-01-13 14:53:20 +01:00
uuid-tree.h btrfs: move uuid tree related code to uuid-tree.[ch] 2024-09-10 16:51:12 +02:00
verity.c for-6.18-tag 2025-09-30 08:14:49 -07:00
verity.h btrfs: add forward declarations and headers, part 1 2024-03-04 16:24:49 +01:00
volumes.c btrfs: replace BUG() with error handling in __btrfs_balance() 2026-03-04 07:20:42 -05:00
volumes.h btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
xattr.c btrfs: replace strcpy() with strscpy() 2025-07-22 00:05:00 +02:00
xattr.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
zlib.c btrfs: zlib: fix the folio leak on S390 hardware acceleration 2026-02-06 16:57:29 +01:00
zoned.c btrfs: zoned: fixup last alloc pointer after extent removal for RAID0/10 2026-03-12 07:09:31 -04:00
zoned.h btrfs: headers cleanup to remove unnecessary local includes 2026-02-26 14:58:58 -08:00
zstd.c btrfs: add unlikely annotations to branches leading to EIO 2025-09-23 08:49:26 +02:00