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 5/9] xfs: add a xfs_rmap_inode_bmbt_owner
Date: Thu, 17 Sep 2026 11:17:19 -0400 [thread overview]
Message-ID: <20260917151724.693663-5-sashal@kernel.org> (raw)
In-Reply-To: <20260917151724.693663-1-sashal@kernel.org>
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit ee237a900ceef00c8d1ca17a5cfadbd50fba67e9 ]
Add a small wrapper for initializing the bmbt owner to i_ino.
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-dep-of: 865b751e7503 ("xfs: don't stash removename operations with unknown ftype")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/libxfs/xfs_bmap.c | 4 ++--
fs/xfs/libxfs/xfs_bmap_btree.c | 4 ++--
fs/xfs/libxfs/xfs_btree.c | 4 ++--
fs/xfs/libxfs/xfs_rmap.h | 2 ++
fs/xfs/scrub/bmap.c | 2 +-
fs/xfs/scrub/bmap_repair.c | 4 ++--
fs/xfs/scrub/newbt.c | 2 +-
fs/xfs/scrub/reap.c | 2 +-
fs/xfs/scrub/rtrefcount.c | 2 +-
fs/xfs/scrub/rtrmap.c | 3 +--
10 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 73e618d656e25..33a4f047dfdfc 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -602,7 +602,7 @@ xfs_bmap_btree_to_extents(
if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
return error;
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, ip, whichfork);
error = xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo,
XFS_AG_RESV_NONE, 0);
if (error)
@@ -676,7 +676,7 @@ xfs_bmap_extents_to_btree(
memset(&args, 0, sizeof(args));
args.tp = tp;
args.mp = mp;
- xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork);
+ xfs_rmap_inode_bmbt_owner(&args.oinfo, ip, whichfork);
args.minlen = args.maxlen = args.prod = 1;
args.wasdel = wasdel;
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index 188feac04b603..10e0e649a2a09 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -217,7 +217,7 @@ xfs_bmbt_alloc_block(
memset(&args, 0, sizeof(args));
args.tp = cur->bc_tp;
args.mp = cur->bc_mp;
- xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_ino.ip->i_ino,
+ xfs_rmap_inode_bmbt_owner(&args.oinfo, cur->bc_ino.ip,
cur->bc_ino.whichfork);
args.minlen = args.maxlen = args.prod = 1;
args.wasdel = cur->bc_flags & XFS_BTREE_BMBT_WASDEL;
@@ -280,7 +280,7 @@ xfs_bmbt_free_block(
struct xfs_owner_info oinfo;
int error;
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, ip, cur->bc_ino.whichfork);
error = xfs_free_extent_later(cur->bc_tp, fsbno, 1, &oinfo,
XFS_AG_RESV_NONE, 0);
if (error)
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 1b2166ac327a1..90a795d5965c1 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -5607,7 +5607,7 @@ xfs_btree_alloc_metafile_block(
ASSERT(xfs_is_metadir_inode(ip));
- xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, cur->bc_ino.whichfork);
+ xfs_rmap_inode_bmbt_owner(&args.oinfo, ip, cur->bc_ino.whichfork);
error = xfs_alloc_vextent_start_ag(&args, XFS_INODE_TO_FSB(ip));
if (error)
return error;
@@ -5639,7 +5639,7 @@ xfs_btree_free_metafile_block(
ASSERT(xfs_is_metadir_inode(ip));
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, ip, cur->bc_ino.whichfork);
error = xfs_free_extent_later(tp, fsbno, 1, &oinfo, XFS_AG_RESV_METAFILE,
0);
if (error)
diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h
index 5f39f6e53cd19..7188459f61cf3 100644
--- a/fs/xfs/libxfs/xfs_rmap.h
+++ b/fs/xfs/libxfs/xfs_rmap.h
@@ -21,6 +21,8 @@ xfs_rmap_ino_bmbt_owner(
if (whichfork == XFS_ATTR_FORK)
oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
}
+#define xfs_rmap_inode_bmbt_owner(oi, ip, whichfork) \
+ xfs_rmap_ino_bmbt_owner(oi, (ip)->i_ino, whichfork)
static inline void
xfs_rmap_ino_owner(
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index 845e1538077e3..ba7cb3837c752 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -600,7 +600,7 @@ xchk_bmap_btree(
/* Check the btree structure. */
cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, ip, whichfork);
error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info);
xfs_btree_del_cursor(cur, error);
out:
diff --git a/fs/xfs/scrub/bmap_repair.c b/fs/xfs/scrub/bmap_repair.c
index 747cd9389b491..fa6bb8673b0fb 100644
--- a/fs/xfs/scrub/bmap_repair.c
+++ b/fs/xfs/scrub/bmap_repair.c
@@ -760,7 +760,7 @@ xrep_bmap_build_new_fork(
* Prepare to construct the new fork by initializing the new btree
* structure and creating a fake ifork in the ifakeroot structure.
*/
- xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, rb->whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, rb->whichfork);
error = xrep_newbt_init_inode(&rb->new_bmapbt, sc, rb->whichfork,
&oinfo);
if (error)
@@ -833,7 +833,7 @@ xrep_bmap_remove_old_tree(
struct xfs_owner_info oinfo;
/* Free the old bmbt blocks if they're not in use. */
- xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, rb->whichfork);
+ xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, rb->whichfork);
return xrep_reap_fsblocks(sc, &rb->old_bmbt_blocks, &oinfo);
}
diff --git a/fs/xfs/scrub/newbt.c b/fs/xfs/scrub/newbt.c
index 40e10ba4db371..b89ff2b43c4fd 100644
--- a/fs/xfs/scrub/newbt.c
+++ b/fs/xfs/scrub/newbt.c
@@ -145,7 +145,7 @@ xrep_newbt_init_metadir_inode(
ASSERT(xfs_is_metadir_inode(sc->ip));
- xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, XFS_DATA_FORK);
+ xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, XFS_DATA_FORK);
ifp = kmem_cache_zalloc(xfs_ifork_cache, XCHK_GFP_FLAGS);
if (!ifp)
diff --git a/fs/xfs/scrub/reap.c b/fs/xfs/scrub/reap.c
index 07f5bb8a64212..fbd0460dc06d3 100644
--- a/fs/xfs/scrub/reap.c
+++ b/fs/xfs/scrub/reap.c
@@ -1205,7 +1205,7 @@ xrep_reap_metadir_fsblocks(
ASSERT(xfs_is_metadir_inode(sc->ip));
xreap_configure_agextent_limits(&rs);
- xfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, XFS_DATA_FORK);
+ xfs_rmap_inode_bmbt_owner(&oinfo, sc->ip, XFS_DATA_FORK);
error = xfsb_bitmap_walk(bitmap, xreap_fsmeta_extent, &rs);
if (error)
return error;
diff --git a/fs/xfs/scrub/rtrefcount.c b/fs/xfs/scrub/rtrefcount.c
index 24eb2a664aab8..1fee16e4e2339 100644
--- a/fs/xfs/scrub/rtrefcount.c
+++ b/fs/xfs/scrub/rtrefcount.c
@@ -556,7 +556,7 @@ xchk_rtrefcountbt(
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
return error;
- xfs_rmap_ino_bmbt_owner(&btree_oinfo, rtg_refcount(sc->sr.rtg)->i_ino,
+ xfs_rmap_inode_bmbt_owner(&btree_oinfo, rtg_refcount(sc->sr.rtg),
XFS_DATA_FORK);
error = xchk_btree(sc, sc->sr.refc_cur, xchk_rtrefcountbt_rec,
&btree_oinfo, &rrc);
diff --git a/fs/xfs/scrub/rtrmap.c b/fs/xfs/scrub/rtrmap.c
index e75fa9c095e0b..1e52d1e731a99 100644
--- a/fs/xfs/scrub/rtrmap.c
+++ b/fs/xfs/scrub/rtrmap.c
@@ -250,7 +250,6 @@ int
xchk_rtrmapbt(
struct xfs_scrub *sc)
{
- struct xfs_inode *ip = rtg_rmap(sc->sr.rtg);
struct xfs_owner_info oinfo;
struct xchk_rtrmap cr = { };
int error;
@@ -259,7 +258,7 @@ xchk_rtrmapbt(
if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
return error;
- xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, XFS_DATA_FORK);
+ xfs_rmap_inode_bmbt_owner(&oinfo, rtg_rmap(sc->sr.rtg), XFS_DATA_FORK);
return xchk_btree(sc, sc->sr.rmap_cur, xchk_rtrmapbt_rec, &oinfo, &cr);
}
--
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 ` Sasha Levin [this message]
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 ` [PATCH 6.18.y 8/9] xfs: remove the i_ino field in struct xfs_inode Sasha Levin
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-5-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