From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>,
Carlos Maiolino <cmaiolino@redhat.com>,
"Darrick J. Wong" <djwong@kernel.org>,
Carlos Maiolino <cem@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.18.y 8/9] xfs: remove the i_ino field in struct xfs_inode
Date: Thu, 17 Sep 2026 11:17:22 -0400 [thread overview]
Message-ID: <20260917151724.693663-8-sashal@kernel.org> (raw)
In-Reply-To: <20260917151724.693663-1-sashal@kernel.org>
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 1113a6d6d5d1336f4415fa1367aac0f853f0892d ]
Now that the VFS inode has a u64 i_ino field, there is no need to store
a copy of the inode number in the xfs_inode structure.
Introduce an I_INO() wrapper as a shortcut to the inode number so that
we don't have to propagate the VFS inode everywhere.
The only non-obvious part is the clearing of i_ino to 0 for RCU freeing
the inode. None of this calls into VFS paths, which makes clearing the
VFS inode field here just as safe as clearing the old field in the
xfs_inode.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Stable backport for 865b751e75039fc07838b3200f9740256653da9a:
The 6.18 VFS inode still stores i_ino as unsigned long. Keep the existing
64-bit xfs_inode.i_ino field and its initialization/reclaim lifecycle so
that inode numbers are not truncated on 32-bit systems.
Retain only the I_INO accessor and the two dirent-stashing conversions in
xrep_dir_live_update that the target patch needs. Define I_INO as a macro
using the existing XFS field, without introducing a function. Drop the
remaining field-removal and caller-conversion hunks, including references
to the absent health monitor and newer parent, tracing, and inode APIs.
The upstream subject is retained, but this stable dependency deliberately
does not remove xfs_inode.i_ino.
Also convert the remaining xchk_rtsummary error-path call to
xchk_ip_xref_set_corrupt(sc, rbmip). The preceding stable dependency
7a4a29522ee8 renamed that helper but missed this stable-only caller,
leaving allmodconfig builds with an implicit-function-declaration error.
This completes the caller conversion without adding a function.
[ sashal: Reduced backport -- upstream 1113a6d6d5d13 touches 91 file(s), this
backport carries 3. Not backported here:
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_attr_leaf.c
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_btree_staging.c
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_dir2.c
... and 81 more
This note is generated from the file lists only; see the resolution record
for the reasoning. ]
Stable-dep-of: 865b751e7503 ("xfs: don't stash removename operations with unknown ftype")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/scrub/dir_repair.c | 4 ++--
fs/xfs/scrub/rtsummary.c | 2 +-
fs/xfs/xfs_inode.h | 3 +++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/scrub/dir_repair.c b/fs/xfs/scrub/dir_repair.c
index 92603d1e51c47..a56eb621bd978 100644
--- a/fs/xfs/scrub/dir_repair.c
+++ b/fs/xfs/scrub/dir_repair.c
@@ -1374,10 +1374,10 @@ xrep_dir_live_update(
mutex_lock(&rd->pscan.lock);
if (p->delta > 0)
error = xrep_dir_stash_createname(rd, p->name,
- p->ip->i_ino);
+ I_INO(p->ip));
else
error = xrep_dir_stash_removename(rd, p->name,
- p->ip->i_ino);
+ I_INO(p->ip));
mutex_unlock(&rd->pscan.lock);
if (error)
goto out_abort;
diff --git a/fs/xfs/scrub/rtsummary.c b/fs/xfs/scrub/rtsummary.c
index a1e2aa580bc1b..8fb06ce4a2003 100644
--- a/fs/xfs/scrub/rtsummary.c
+++ b/fs/xfs/scrub/rtsummary.c
@@ -359,7 +359,7 @@ xchk_rtsummary(
* EFSCORRUPTED means the rtbitmap is corrupt, which is an xref
* error since we're checking the summary file.
*/
- xchk_ino_xref_set_corrupt(sc, rbmip->i_ino);
+ xchk_ip_xref_set_corrupt(sc, rbmip);
return 0;
}
if (error)
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index bd6d335571943..5271d2680c2f8 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -184,6 +184,9 @@ static inline const struct inode *VFS_IC(const struct xfs_inode *ip)
return &ip->i_vnode;
}
+/* The VFS inode number can still be 32 bits on this branch. */
+#define I_INO(ip) ((ip)->i_ino)
+
/*
* For regular files we only update the on-disk filesize when actually
* writing data back to disk. Until then only the copy in the VFS inode
--
2.53.0
next prev parent reply other threads:[~2026-09-17 15:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 17:26 FAILED: patch "[PATCH] xfs: don't stash removename operations with unknown ftype" failed to apply to 6.18-stable tree gregkh
2026-09-17 15:17 ` [PATCH 6.18.y 1/9] xfs: factor out xfs_attr3_leaf_init Sasha Levin
2026-09-17 15:17 ` [PATCH 6.18.y 2/9] xfs: add a XFS_INODE_TO_AGNO helper Sasha Levin
2026-09-17 15:17 ` [PATCH 6.18.y 3/9] xfs: add a XFS_INODE_TO_AGINO helper Sasha Levin
2026-09-17 15:17 ` [PATCH 6.18.y 4/9] xfs: add a XFS_INO_TO_FSB helper Sasha Levin
2026-09-17 15:17 ` [PATCH 6.18.y 5/9] xfs: add a xfs_rmap_inode_bmbt_owner Sasha Levin
2026-09-17 15:17 ` [PATCH 6.18.y 6/9] xfs: add a xfs_rmap_inode_owner helper Sasha Levin
2026-09-17 15:17 ` [PATCH 6.18.y 7/9] xfs: convert xchk_inode_xref_set_corrupt to xchk_ip_xref_set_corrupt Sasha Levin
2026-09-17 15:17 ` Sasha Levin [this message]
2026-09-17 15:17 ` [PATCH 6.18.y 9/9] xfs: don't stash removename operations with unknown ftype Sasha Levin
2026-09-23 8:02 ` [PATCH 6.18.y 1/9] xfs: factor out xfs_attr3_leaf_init Greg KH
2026-09-25 18:48 ` Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260917151724.693663-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=cem@kernel.org \
--cc=cmaiolino@redhat.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox