From: Eduard Zateev <hackerowskiy@gmail.com>
To: hackerowskiy@gmail.com
Cc: "Darrick J. Wong" <djwong@kernel.org>,
stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Carlos Maiolino <cem@kernel.org>
Subject: [PATCH 02/26] xfs: don't assert when XFS_SCRUB_TYPE_HEALTHY scans return corruption
Date: Tue, 22 Sep 2026 13:01:57 +0200 [thread overview]
Message-ID: <20260922110221.1431-2-hackerowskiy@gmail.com> (raw)
In-Reply-To: <20260922110221.1431-1-hackerowskiy@gmail.com>
From: "Darrick J. Wong" <djwong@kernel.org>
XFS_SCRUB_TYPE_HEALTHY is a synthentic scrub type so that xfs_scrub can
tell the kernel "Hey, I finished a scan and saw no problems" and have
the kernel forget that it saw indirect evidence of corruption.
Unfortunately, as LOLLM points out, it's possible for the health system
to record a new corruption just before xfs_scrub gets to
XFS_SCRUB_TYPE_HEALTHY. In this case, the existing logic doesn't return
early and instead wanders into unknown regions of type_to_health_flag
and trips the assert because HEALTHY doesn't have a group assignment.
Fix the logic so that we always return early for a HEALTHY scrub type,
even if we decide not to call xchk_mark_all_healthy.
Cc: stable@vger.kernel.org # v6.9
Fixes: a1f3e0cca41036 ("xfs: update health status if we get a clean bill of health")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
---
fs/xfs/scrub/health.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/scrub/health.c b/fs/xfs/scrub/health.c
index 2171bcf0f6c1..487ecc5f9f3c 100644
--- a/fs/xfs/scrub/health.c
+++ b/fs/xfs/scrub/health.c
@@ -202,9 +202,9 @@ xchk_update_health(
* there's no sick flag defined for it, so we branch here ahead of the
* mask check.
*/
- if (sc->sm->sm_type == XFS_SCRUB_TYPE_HEALTHY &&
- !(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) {
- xchk_mark_all_healthy(sc->mp);
+ if (sc->sm->sm_type == XFS_SCRUB_TYPE_HEALTHY) {
+ if (!(sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
+ xchk_mark_all_healthy(sc->mp);
return;
}
--
2.55.0
next parent reply other threads:[~2026-09-22 11:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260922110221.1431-1-hackerowskiy@gmail.com>
2026-09-22 11:01 ` Eduard Zateev [this message]
2026-09-22 11:01 ` [PATCH 03/26] xfs: fix attr fork block count checks in xrep_inode_blockcounts Eduard Zateev
2026-09-22 11:01 ` [PATCH 04/26] xfs: release orphanage dir inode if chown fails Eduard Zateev
2026-09-22 11:02 ` [PATCH 06/26] xfs: use correct jiffies comparison function in xchk_maybe_relax Eduard Zateev
2026-09-22 11:02 ` [PATCH 07/26] xfs: check padding field in xfs_ioc_commit_range Eduard Zateev
2026-09-22 11:02 ` [PATCH 08/26] xfs: don't call xfs_exchange_range_finish for a dry run Eduard Zateev
2026-09-22 11:02 ` [PATCH 09/26] xfs: use the correct reservations for rtrmap/refcount recovery Eduard Zateev
2026-09-22 11:02 ` [PATCH 11/26] xfs: only flag zero padding for dir3 data blocks, not dir3 block blocks Eduard Zateev
2026-09-22 11:02 ` [PATCH 12/26] xfs: check di_forkoff correctly in scrub Eduard Zateev
2026-09-22 11:02 ` [PATCH 17/26] xfs: call xfs_dquot_set_prealloc_limits if we installed default rtb limits Eduard Zateev
2026-09-22 11:02 ` [PATCH 18/26] xfs: fix rtgroup repair estimations Eduard Zateev
2026-09-22 11:02 ` [PATCH 19/26] xfs: don't cross reference rmapbt with bitmaps if they're incomplete Eduard Zateev
2026-09-22 11:02 ` [PATCH 20/26] xfs: don't let memory failures leak blocks and kill repairs Eduard Zateev
2026-09-22 11:02 ` [PATCH 21/26] xfs: don't merge different file IO error types Eduard Zateev
2026-09-22 11:02 ` [PATCH 22/26] xfs: fix blockgc group quota scanning when usrquota isn't enforced Eduard Zateev
2026-09-22 11:02 ` [PATCH 23/26] xfs: fix cursor and pointer handling when recovering iunlink buckets Eduard Zateev
2026-09-22 11:02 ` [PATCH 24/26] xfs: drop dquot flush lock when we can't find a buffer to flush Eduard Zateev
2026-09-22 11:02 ` [PATCH 25/26] xfs: don't let hidden_space go negative in xfs_metafile_resv_init Eduard Zateev
2026-09-22 11:02 ` [PATCH 26/26] xfs: fix wild memcpy access when formatting ondisk rtrefcount btree roots Eduard Zateev
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=20260922110221.1431-2-hackerowskiy@gmail.com \
--to=hackerowskiy@gmail.com \
--cc=cem@kernel.org \
--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