[GIT PULL 03/16 for v7.2] vfs inode

From: Christian Brauner

Date: Fri Jun 12 2026 - 11:15:00 EST


Hey Linus,

/* Summary */

This extends the lockless ->i_count handling. iput() could already
decrement any value greater than 1 locklessly but acquiring a
reference always required taking inode->i_lock. Now acquiring a
reference is lockless as long as the count was already at least 1,
i.e., only the 0->1 and 1->0 transitions take the lock. This avoids
the lock for the common cases of nfs calling into the inode hash and
btrfs using igrab(). Cleanup-wise icount_read_once() is added to line
up with inode_state_read_once() and the open-coded ->i_count loads
across the tree are converted, and ihold() is relocated and tidied up.

On top of that some stale lock ordering annotations are retired from
the inode hash code: iunique() no longer takes the hash lock since the
inode hash became RCU-searchable and s_inode_list_lock is no longer
taken under the hash lock either.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3+b1)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

This has a merge conflict with the xfs tree in fs/xfs/xfs_trace.h
between commit 1113a6d6d5d133 ("xfs: remove the i_ino field in struct
xfs_inode") from the xfs tree and commit 769e143b115a4a ("fs: add
icount_read_once() and stop open-coding ->i_count loads") from this
tree, reported in [1]. It can be resolved as follows:

[1]: https://lore.kernel.org/linux-next/aigwDvQMI2CHiLl3@xxxxxxxxxxxx

diff --cc fs/xfs/xfs_trace.h
index ae5faa78783005,f87c738d84b248..00000000000000
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@@ -1157,8 -1157,8 +1157,8 @@@ DECLARE_EVENT_CLASS(xfs_iref_class
),
TP_fast_assign(
__entry->dev = VFS_I(ip)->i_sb->s_dev;
- __entry->ino = ip->i_ino;
+ __entry->ino = I_INO(ip);
- __entry->count = icount_read(VFS_I(ip));
+ __entry->count = icount_read_once(VFS_I(ip));
__entry->pincount = atomic_read(&ip->i_pincount);
__entry->iflags = ip->i_flags;
__entry->caller_ip = caller_ip;

The following changes since commit 254f49634ee16a731174d2ae34bc50bd5f45e731:

Linux 7.1-rc1 (2026-04-26 14:19:00 -0700)

are available in the Git repository at:

git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.2-rc1.inode

for you to fetch changes up to 5b451b76c85c8309d2e02caa467b38f5999c986f:

fs: retire stale lock ordering annotations from inode hash (2026-05-11 23:12:29 +0200)

----------------------------------------------------------------
vfs-7.2-rc1.inode

Please consider pulling these changes from the signed vfs-7.2-rc1.inode tag.

Thanks!
Christian

----------------------------------------------------------------
Christian Brauner (1):
Merge patch series "assorted ->i_count changes + extension of lockless handling"

Mateusz Guzik (4):
fs: add icount_read_once() and stop open-coding ->i_count loads
fs: relocate and tidy up ihold()
fs: allow lockless ->i_count bumps as long as it does not transition 0->1
fs: retire stale lock ordering annotations from inode hash

arch/powerpc/platforms/cell/spufs/file.c | 2 +-
fs/btrfs/inode.c | 2 +-
fs/ceph/mds_client.c | 2 +-
fs/dcache.c | 4 ++
fs/ext4/ialloc.c | 4 +-
fs/hpfs/inode.c | 2 +-
fs/inode.c | 100 +++++++++++++++++++++++++------
fs/nfs/inode.c | 4 +-
fs/smb/client/inode.c | 2 +-
fs/ubifs/super.c | 2 +-
fs/xfs/xfs_inode.c | 2 +-
fs/xfs/xfs_trace.h | 2 +-
include/linux/fs.h | 13 ++++
include/trace/events/filelock.h | 2 +-
security/landlock/fs.c | 2 +-
15 files changed, 112 insertions(+), 33 deletions(-)