Skip to contentSkip to conversation

FAILED: patch "[PATCH] xfs: jump out of xchk_bmap_check_rmap if fatal signals" failed to apply to 5.10-stable tree

PATCH New [email protected] 2 participants 2 messages Nov 4 – Nov 5

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-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]>.

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-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 49d300a51442bd64b627645b7b0b1cd66e492905
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026110430-implant-perch-2ec4@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 49d300a51442bd64b627645b7b0b1cd66e492905 Mon Sep 17 00:00:00 2001
From: "Darrick J. Wong" <[email protected]>
Date: Thu, 24 Sep 2026 21:13:06 -0700
Subject: [PATCH] xfs: jump out of xchk_bmap_check_rmap if fatal signals

LOLLM observes that we never check for fatal signals inside the loop that checks file fork mappings against the rmapbt. This can lead to lengthy delays in responding to a ^C, so add some bailout checks.

Fixes 5e777b62b0bcb6 ("xfs: bmap scrubber should do rmap xref with bmap for sparse files")
Assisted-by LOLLM # finding obvious bugs
fs/xfs/scrub/bmap.c +7 -0
index c190590bc562..4dff40dd426a 100644
@@ -625,6 +625,10 @@ xchk_bmap_check_rmap(
 	struct xfs_ifork		*ifp;
 	struct xfs_scrub		*sc = sbcri->sc;
 	bool				have_map;
+	int				error = 0;
+
+	if (xchk_should_terminate(sc, &error))
+		return error;
 
 	/* Is this even the right fork? */
 	if (rec->rm_owner != I_INO(sc->ip))
@@ -656,6 +660,9 @@ xchk_bmap_check_rmap(
 	 */
 	check_rec = *rec;
 	while (have_map) {
+		if (xchk_should_terminate(sc, &error))
+			return error;
+
 		if (irec.br_startoff != check_rec.rm_offset)
 			xchk_fblock_set_corrupt(sc, sbcri->whichfork,
 					check_rec.rm_offset);
maintainer
#1 lore raw

PATCH 1/1 xfs: jump out of xchk_bmap_check_rmap if fatal signals

From: "Darrick J. Wong" <[email protected]>

[ Upstream commit 49d300a51442bd64b627645b7b0b1cd66e492905 ]

LOLLM observes that we never check for fatal signals inside the loop that checks file fork mappings against the rmapbt. This can lead to lengthy delays in responding to a ^C, so add some bailout checks.

Fixes 5e777b62b0bcb6 ("xfs: bmap scrubber should do rmap xref with bmap for sparse files")
Assisted-by LOLLM # finding obvious bugs
[ sashal: Adjusted loop context to preserve direct updates to rec instead of using a check_rec copy. ]
---
 fs/xfs/scrub/bmap.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/xfs/scrub/bmap.c +7 -0
index fed56d213a3f9..5748545afb5be 100644
@@ -487,6 +487,10 @@ xchk_bmap_check_rmap(
 	struct xfs_ifork		*ifp;
 	struct xfs_scrub		*sc = sbcri->sc;
 	bool				have_map;
+	int				error = 0;
+
+	if (xchk_should_terminate(sc, &error))
+		return error;
 
 	/* Is this even the right fork? */
 	if (rec->rm_owner != sc->ip->i_ino)
@@ -517,6 +521,9 @@ xchk_bmap_check_rmap(
 	 * entire rmap is covered by bmbt records.
 	 */
 	while (have_map) {
+		if (xchk_should_terminate(sc, &error))
+			return error;
+
 		if (irec.br_startoff != rec->rm_offset)
 			xchk_fblock_set_corrupt(sc, sbcri->whichfork,
 					rec->rm_offset);
Signature · 1 line
2.53.0