[GIT PULL] Btrfs updates for 7.4, part 2

From: David Sterba

Date: Sun Oct 25 2026 - 13:03:53 EST


Hi,

this pull request removes unused code of free space caching, disabled in
7.3 (545e560a5b0f "btrfs: disable v1 space cache").

It's been the original free space cache feature, superseded by free
space tree (4.5) and mkfs default since 5.15. The grace period was
sufficiently long, backward compatibility still exists with a
performance impact, effectively as if mounted with '-o nospace_cache'.

This is a separate pull as there were a few iterations based on sashiko
feedback, but 90% of the code has been in linux-next within the
pre-merge window period. Too late I noticed a glitch in the branch,
unrelated commit "btrfs: fix use-after-free on quota enable allocation
failure" is duplicated due to addition of reviewed-by to the original
base (no code change). If anything of that is a problem, postponing the
merge is also fine for us.

Please consider pulling, thanks.

----------------------------------------------------------------
The following changes since commit 940983a3000361ddff834a1c55bdb0e9e47ed88b:

btrfs: prevent use-after-free in btrfs_transaction::switch_commits (2026-10-12 19:18:10 +0200)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git tags/for-7.4-part2-tag

for you to fetch changes up to 293aae0123e1c178c7f76fd7a93bcced41e6663c:

btrfs: remove TRANS_JOIN_NOLOCK (2026-10-16 19:10:46 +0200)

----------------------------------------------------------------
Tal Zussman (19):
btrfs: drop the extent maps of the written part of a failed ordered extent
btrfs: update the inode item when removing a free space inode
btrfs: stop enabling the v1 space cache from the on-disk state
btrfs: remove the v1 space cache writeout from the transaction commit
btrfs: remove the free space cache endio workqueue
btrfs: remove the v1 space cache write path
btrfs: rename cache_write_mutex to dirty_bgs_update_mutex
btrfs: drop the transaction handle from the prealloc helpers
btrfs: remove the v1 space cache load path
btrfs: remove btrfs_disk_cache_state
btrfs: remove the SPACE_CACHE mount option flag
btrfs: replace btrfs_set_free_space_cache_v1_active() with a cleanup helper
btrfs: remove the free space cache trimming ranges
btrfs: remove BTRFS_RESERVE_FLUSH_FREE_SPACE_INODE
btrfs: remove the free space inode ordered extent special cases
btrfs: remove the free space inode special cases from the COW paths
btrfs: stop special-casing free space inodes in the delalloc accounting
btrfs: stop reading free space inodes from the commit root
btrfs: remove TRANS_JOIN_NOLOCK

Yalagada Pavan Kumar (1):
btrfs: fix use-after-free on quota enable allocation failure

fs/btrfs/block-group.c | 497 ++--------------
fs/btrfs/block-group.h | 14 -
fs/btrfs/btrfs_inode.h | 6 -
fs/btrfs/delalloc-space.c | 13 +-
fs/btrfs/disk-io.c | 81 +--
fs/btrfs/file-item.c | 11 -
fs/btrfs/free-space-cache.c | 1354 +------------------------------------------
fs/btrfs/free-space-cache.h | 29 +-
fs/btrfs/fs.h | 2 -
fs/btrfs/inode.c | 155 +----
fs/btrfs/ordered-data.c | 27 +-
fs/btrfs/qgroup.c | 7 +
fs/btrfs/relocation.c | 2 +-
fs/btrfs/space-info.c | 2 -
fs/btrfs/space-info.h | 4 -
fs/btrfs/super.c | 48 +-
fs/btrfs/transaction.c | 62 +-
fs/btrfs/transaction.h | 27 +-
fs/btrfs/zoned.c | 9 -
19 files changed, 154 insertions(+), 2196 deletions(-)