FAILED: Patch "xfs: check return value of xchk_scrub_create_subord" failed to apply to 6.12-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.12-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 <[email protected]>.
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From ca27313fb3f23e4ac18532ede4ec1c7cc5814c4a Mon Sep 17 00:00:00 2001
From: "Darrick J. Wong" <[email protected]>
Date: Fri, 23 Jan 2026 09:27:38 -0800
Subject: [PATCH] xfs: check return value of xchk_scrub_create_subord
Fix this function to return NULL instead of a mangled ENOMEM, then fix the callers to actually check for a null pointer and return ENOMEM. Most of the corrections here are for code merged between 6.2 and 6.10.
Cc <[email protected]> # v6.12
Fixes 1a5f6e08d4e379 ("xfs: create subordinate scrub contexts for xchk_metadata_inode_subtype")
Signed-off-by "Darrick J. Wong" <[email protected]>
Reviewed-by Christoph Hellwig <[email protected]>
Tested-by Jiaming Zhang <[email protected]>
--- fs/xfs/scrub/common.c | 3 +++ fs/xfs/scrub/repair.c | 3 +++ fs/xfs/scrub/scrub.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-)
fs/xfs/scrub/common.c +3 -0
@@ -1399,6 +1399,9 @@ xchk_metadata_inode_subtype(int error; sub =xchk_scrub_create_subord (sc, scrub_type); +if (!sub) +return -ENOMEM ; + error = sub->sc.ops->scrub (&sub->sc);xchk_scrub_free_subord (sub);return error;
fs/xfs/scrub/repair.c +3 -0
@@ -1136,6 +1136,9 @@ xrep_metadata_inode_subtype(* setup/teardown routines. */ sub =xchk_scrub_create_subord (sc, scrub_type); +if (!sub) +return -ENOMEM ; + error = sub->sc.ops->scrub (&sub->sc);if (error) goto out;
fs/xfs/scrub/scrub.c +1 -1
@@ -634,7 +634,7 @@ xchk_scrub_create_subord( sub =kzalloc (sizeof (*sub),XCHK_GFP_FLAGS );if (!sub) -return ERR_PTR (-ENOMEM ); +return NULL ; sub->old_smtype = sc->sm->sm_type; sub->old_smflags = sc->sm->sm_flags;
Signature · 1 line
2.51.0