Linux kernel -stable discussions
 help / color / mirror / Atom feed
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 6/9] xfs: add a xfs_rmap_inode_owner helper
Date: Thu, 17 Sep 2026 11:17:20 -0400	[thread overview]
Message-ID: <20260917151724.693663-6-sashal@kernel.org> (raw)
In-Reply-To: <20260917151724.693663-1-sashal@kernel.org>

From: Christoph Hellwig <hch@lst.de>

[ Upstream commit f882fc7dd9f04f73d94379deb9e68d8db613c976 ]

Add a small wrapper for initializing the rmap 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 | 2 +-
 fs/xfs/libxfs/xfs_rmap.h | 2 ++
 fs/xfs/scrub/bmap.c      | 6 +++---
 fs/xfs/scrub/reap.c      | 3 +--
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 33a4f047dfdfc..ddcba236b07ec 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -819,7 +819,7 @@ xfs_bmap_local_to_extents(
 	args.mp = ip->i_mount;
 	args.total = total;
 	args.minlen = args.maxlen = args.prod = 1;
-	xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0);
+	xfs_rmap_inode_owner(&args.oinfo, ip, whichfork, 0);
 
 	/*
 	 * Allocate a block.  We know we need only one, since the
diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h
index 7188459f61cf3..6016fd5fcad98 100644
--- a/fs/xfs/libxfs/xfs_rmap.h
+++ b/fs/xfs/libxfs/xfs_rmap.h
@@ -37,6 +37,8 @@ xfs_rmap_ino_owner(
 	if (whichfork == XFS_ATTR_FORK)
 		oi->oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
 }
+#define xfs_rmap_inode_owner(oi, ip, whichfork, offset) \
+	xfs_rmap_ino_owner(oi, (ip)->i_ino, whichfork, offset)
 
 static inline bool
 xfs_rmap_should_skip_owner_update(
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index ba7cb3837c752..7f5aeee495727 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -352,7 +352,7 @@ xchk_bmap_rt_iextent_xref(
 	case XFS_DATA_FORK:
 		xchk_bmap_xref_rmap(info, irec, rgbno);
 		if (!xfs_is_reflink_inode(info->sc->ip)) {
-			xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
+			xfs_rmap_inode_owner(&oinfo, info->sc->ip,
 					info->whichfork, irec->br_startoff);
 			xchk_xref_is_only_rt_owned_by(info->sc, rgbno,
 					irec->br_blockcount, &oinfo);
@@ -407,7 +407,7 @@ xchk_bmap_iextent_xref(
 	case XFS_DATA_FORK:
 		xchk_bmap_xref_rmap(info, irec, agbno);
 		if (!xfs_is_reflink_inode(info->sc->ip)) {
-			xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
+			xfs_rmap_inode_owner(&oinfo, info->sc->ip,
 					info->whichfork, irec->br_startoff);
 			xchk_xref_is_only_owned_by(info->sc, agbno,
 					irec->br_blockcount, &oinfo);
@@ -419,7 +419,7 @@ xchk_bmap_iextent_xref(
 		break;
 	case XFS_ATTR_FORK:
 		xchk_bmap_xref_rmap(info, irec, agbno);
-		xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino,
+		xfs_rmap_inode_owner(&oinfo, info->sc->ip,
 				info->whichfork, irec->br_startoff);
 		xchk_xref_is_only_owned_by(info->sc, agbno, irec->br_blockcount,
 				&oinfo);
diff --git a/fs/xfs/scrub/reap.c b/fs/xfs/scrub/reap.c
index fbd0460dc06d3..e6784c7615d8b 100644
--- a/fs/xfs/scrub/reap.c
+++ b/fs/xfs/scrub/reap.c
@@ -1249,8 +1249,7 @@ xreap_bmapi_select(
 	cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, sc->sa.agf_bp,
 			sc->sa.pag);
 
-	xfs_rmap_ino_owner(&oinfo, rs->ip->i_ino, rs->whichfork,
-			imap->br_startoff);
+	xfs_rmap_inode_owner(&oinfo, rs->ip, rs->whichfork, imap->br_startoff);
 	error = xfs_rmap_has_other_keys(cur, agbno, 1, &oinfo, crosslinked);
 	if (error)
 		goto out_cur;
-- 
2.53.0


  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   ` Sasha Levin [this message]
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-6-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