From: Carlos Maiolino <cem@kernel.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: hch@lst.de, stable@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/6] xfs: snapshot scrub stats when rendering them
Date: Fri, 4 Sep 2026 08:48:00 +0200 [thread overview]
Message-ID: <apppmoGnOMa9QVyZ@andromeda.toxiclabs.cc> (raw)
In-Reply-To: <178850312518.1198660.12930219318866018921.stgit@frogsfrogsfrogs>
On Thu, Sep 03, 2026 at 11:26:02PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> LOLLM complains about concurrency problems in the scrub stats code
> because xchk_stats_format doesn't synchronize in any way with updates.
> These stats are only reported through debugfs so I don't think it really
> matters, but I guess I exist to make bots happy now.
>
> Cc: <stable@vger.kernel.org> # v6.6
> Fixes: d7a74cad8f4513 ("xfs: track usage statistics of online fsck")
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> Assisted-by: LOLLM # finding obvious bugs
> ---
> fs/xfs/scrub/stats.c | 32 +++++++++++++++++++-------------
> 1 file changed, 19 insertions(+), 13 deletions(-)
>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
>
> diff --git a/fs/xfs/scrub/stats.c b/fs/xfs/scrub/stats.c
> index 76f2515188d1b1..f3f1fbfb6d9955 100644
> --- a/fs/xfs/scrub/stats.c
> +++ b/fs/xfs/scrub/stats.c
> @@ -99,25 +99,31 @@ xchk_stats_format(
> int ret = 0;
>
> for (i = 0; i < XFS_SCRUB_TYPE_NR; i++, css++) {
> + struct xchk_scrub_stats fss;
> +
> if (!name_map[i])
> continue;
>
> + spin_lock(&css->css_lock);
> + memcpy(&fss, css, offsetof(struct xchk_scrub_stats, css_lock));
> + spin_unlock(&css->css_lock);
> +
> ret = scnprintf(buf, remaining,
> "%s %u %u %u %u %u %u %u %u %u %llu %u %u %llu\n",
> name_map[i],
> - (unsigned int)css->invocations,
> - (unsigned int)css->clean,
> - (unsigned int)css->corrupt,
> - (unsigned int)css->preen,
> - (unsigned int)css->xfail,
> - (unsigned int)css->xcorrupt,
> - (unsigned int)css->incomplete,
> - (unsigned int)css->warning,
> - (unsigned int)css->retries,
> - (unsigned long long)css->checktime_us,
> - (unsigned int)css->repair_invocations,
> - (unsigned int)css->repair_success,
> - (unsigned long long)css->repairtime_us);
> + (unsigned int)fss.invocations,
> + (unsigned int)fss.clean,
> + (unsigned int)fss.corrupt,
> + (unsigned int)fss.preen,
> + (unsigned int)fss.xfail,
> + (unsigned int)fss.xcorrupt,
> + (unsigned int)fss.incomplete,
> + (unsigned int)fss.warning,
> + (unsigned int)fss.retries,
> + (unsigned long long)fss.checktime_us,
> + (unsigned int)fss.repair_invocations,
> + (unsigned int)fss.repair_success,
> + (unsigned long long)fss.repairtime_us);
> if (ret <= 0)
> break;
>
>
>
next prev parent reply other threads:[~2026-09-04 6:48 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 6:25 [PATCHSET] xfs: LLM-inspired bug fixes, part 11 Darrick J. Wong
2026-09-04 6:26 ` [PATCH 1/6] xfs: snapshot scrub stats when rendering them Darrick J. Wong
2026-09-04 6:48 ` Carlos Maiolino [this message]
2026-09-07 5:58 ` Christoph Hellwig
2026-09-08 4:43 ` Darrick J. Wong
2026-09-04 6:26 ` [PATCH 2/6] xfs: report healthy filesystem events in scrub stats Darrick J. Wong
2026-09-04 6:48 ` Carlos Maiolino
2026-09-07 5:58 ` Christoph Hellwig
2026-09-04 6:26 ` [PATCH 3/6] xfs: report runtime failures in scrub Darrick J. Wong
2026-09-04 6:59 ` Carlos Maiolino
2026-09-07 5:59 ` Christoph Hellwig
2026-09-04 6:26 ` [PATCH 4/6] xfs: remove redundant function declaration Darrick J. Wong
2026-09-04 6:59 ` Carlos Maiolino
2026-09-07 5:59 ` Christoph Hellwig
2026-09-04 6:27 ` [PATCH 5/6] xfs: snapshot old AGFL before rewriting it Darrick J. Wong
2026-09-04 7:34 ` Carlos Maiolino
2026-09-07 6:01 ` Christoph Hellwig
2026-09-04 6:27 ` [PATCH 6/6] xfs: bail out on bitmap errors in xrep_agfl_fill Darrick J. Wong
2026-09-04 7:38 ` Carlos Maiolino
2026-09-04 16:12 ` Darrick J. Wong
2026-09-04 16:13 ` [PATCH v1.1 " Darrick J. Wong
2026-09-04 19:11 ` Carlos Maiolino
2026-09-07 6:01 ` Christoph Hellwig
2026-09-07 6:28 ` Carlos Maiolino
2026-09-07 6:34 ` Carlos Maiolino
-- strict thread matches above, loose matches on Subject: below --
2026-09-09 6:02 [PATCHSET 1/2] xfs: LLM-inspired bug fixes, part 11 Darrick J. Wong
2026-09-09 6:03 ` [PATCH 1/6] xfs: snapshot scrub stats when rendering them Darrick J. Wong
2026-09-10 4:56 ` Christoph Hellwig
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=apppmoGnOMa9QVyZ@andromeda.toxiclabs.cc \
--to=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--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