* FAILED: patch "[PATCH] xfs: cross-reference the primary superblock" failed to apply to 6.1-stable tree
@ 2026-11-04 15:16 gregkh
2026-11-05 15:02 ` [PATCH 6.1.y] xfs: cross-reference the primary superblock Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2026-11-04 15:16 UTC (permalink / raw)
To: djwong, cem, hch; +Cc: stable
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 0c61016006ab08f8346f9e7b1e38559bd4ea499e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026110440-single-collision-69cc@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 0c61016006ab08f8346f9e7b1e38559bd4ea499e Mon Sep 17 00:00:00 2001
From: "Darrick J. Wong" <djwong@kernel.org>
Date: Thu, 24 Sep 2026 21:11:32 -0700
Subject: [PATCH] xfs: cross-reference the primary superblock
Make sure we cross-reference the primary superblock against the rest of
the AG 0 space metadata. Drop the unused @bp parameter of
xchk_superblock_xref to avoid complaints about uninitialized variables.
Cc: stable@vger.kernel.org # v4.16
Fixes: 52dc4b44af7419 ("xfs: cross-reference with the bnobt")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index fa5d32ec020a..1dff6cb1b936 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -35,8 +35,7 @@ xchk_setup_agheader(
/* Cross-reference with the other btrees. */
STATIC void
xchk_superblock_xref(
- struct xfs_scrub *sc,
- struct xfs_buf *bp)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
xfs_agnumber_t agno = sc->sm->sm_agno;
@@ -106,16 +105,12 @@ xchk_superblock(
struct xfs_dsb *sb;
struct xfs_perag *pag;
size_t sblen;
- xfs_agnumber_t agno;
+ xfs_agnumber_t agno = sc->sm->sm_agno;
uint32_t v2_ok;
__be32 features_mask;
int error;
__be16 vernum_mask;
- agno = sc->sm->sm_agno;
- if (agno == 0)
- return 0;
-
/*
* Grab an active reference to the perag structure. If we can't get
* it, we're racing with something that's tearing down the AG, so
@@ -125,6 +120,9 @@ xchk_superblock(
if (!pag)
return -ENOENT;
+ if (agno == 0)
+ goto out_xref;
+
error = xfs_sb_read_secondary(mp, sc->tp, agno, &bp);
/*
* The superblock verifier can return several different error codes
@@ -430,7 +428,8 @@ xchk_superblock(
if (memchr_inv((char *)sb + sblen, 0, BBTOB(bp->b_length) - sblen))
xchk_block_set_corrupt(sc, bp);
- xchk_superblock_xref(sc, bp);
+out_xref:
+ xchk_superblock_xref(sc);
out_pag:
xfs_perag_put(pag);
return error;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 6.1.y] xfs: cross-reference the primary superblock
2026-11-04 15:16 FAILED: patch "[PATCH] xfs: cross-reference the primary superblock" failed to apply to 6.1-stable tree gregkh
@ 2026-11-05 15:02 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2026-11-05 15:02 UTC (permalink / raw)
To: stable; +Cc: Darrick J. Wong, Christoph Hellwig, Carlos Maiolino, Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit 0c61016006ab08f8346f9e7b1e38559bd4ea499e ]
Make sure we cross-reference the primary superblock against the rest of
the AG 0 space metadata. Drop the unused @bp parameter of
xchk_superblock_xref to avoid complaints about uninitialized variables.
Cc: stable@vger.kernel.org # v4.16
Fixes: 52dc4b44af7419 ("xfs: cross-reference with the bnobt")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
[ sashal: initialized the error variable to zero in xchk_superblock() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
--git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index b7b838bd4ba43..89193f07b451f 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -23,8 +23,7 @@
/* Cross-reference with the other btrees. */
STATIC void
xchk_superblock_xref(
- struct xfs_scrub *sc,
- struct xfs_buf *bp)
+ struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
xfs_agnumber_t agno = sc->sm->sm_agno;
@@ -64,16 +63,12 @@ xchk_superblock(
struct xfs_buf *bp;
struct xfs_dsb *sb;
struct xfs_perag *pag;
- xfs_agnumber_t agno;
+ xfs_agnumber_t agno = sc->sm->sm_agno;
uint32_t v2_ok;
__be32 features_mask;
- int error;
+ int error = 0;
__be16 vernum_mask;
- agno = sc->sm->sm_agno;
- if (agno == 0)
- return 0;
-
/*
* Grab an active reference to the perag structure. If we can't get
* it, we're racing with something that's tearing down the AG, so
@@ -83,6 +78,9 @@ xchk_superblock(
if (!pag)
return -ENOENT;
+ if (agno == 0)
+ goto out_xref;
+
error = xfs_sb_read_secondary(mp, sc->tp, agno, &bp);
/*
* The superblock verifier can return several different error codes
@@ -344,7 +342,8 @@ xchk_superblock(
BBTOB(bp->b_length) - sizeof(struct xfs_dsb)))
xchk_block_set_corrupt(sc, bp);
- xchk_superblock_xref(sc, bp);
+out_xref:
+ xchk_superblock_xref(sc);
out_pag:
xfs_perag_put(pag);
return error;
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-05 15:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 15:16 FAILED: patch "[PATCH] xfs: cross-reference the primary superblock" failed to apply to 6.1-stable tree gregkh
2026-11-05 15:02 ` [PATCH 6.1.y] xfs: cross-reference the primary superblock Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox