Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: aalbersh@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/8] xfs_scrub: fix estimate of work items for phase 4
Date: Fri, 26 Jun 2026 09:55:25 -0700	[thread overview]
Message-ID: <20260626165525.GY6078@frogsfrogsfrogs> (raw)
In-Reply-To: <20260626050426.GE8786@lst.de>

On Fri, Jun 26, 2026 at 07:04:26AM +0200, Christoph Hellwig wrote:
> On Thu, Jun 25, 2026 at 03:55:31PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Codex complains that the number of work items computed when estimating
> > the amount of work for phase 4 doesn't include the FSCOUNTERS and
> > QUOTACHECK items.  Add them back in.
> > 
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > ---
> >  scrub/phase4.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > 
> > diff --git a/scrub/phase4.c b/scrub/phase4.c
> > index 6bd16c23939eb4..744fd92ab195f4 100644
> > --- a/scrub/phase4.c
> > +++ b/scrub/phase4.c
> > @@ -297,6 +297,10 @@ phase4_estimate(
> >  	need_fixing = action_list_length(ctx->fs_repair_list) +
> >  		      action_list_length(ctx->file_repair_list);
> >  
> > +	/* fscounters and quotacheck */
> > +	if (need_fixing)
> > +		need_fixing += 2;
> > +
> 
> This matches the commit message, but there does this come from?
> Why are fscountれrs and quotachck special?

They're run explicitly by phase4_func so that repairs don't fail with
ENOSPC or EDQUOT if the summary counters (or quota usage numbers) are
wrong.  How about I expand on this in the comments?

phase4_func:

	/*
	 * Check the resource usage counters early.  Normally we do this
	 * during phase 7, but some of the cross-referencing requires
	 * fairly accurate summary counters.  Check and try to repair
	 * them now to minimize the chance that repairs of primary
	 * metadata fail due to secondary metadata or ENOSPC on broken
	 * counters.  If repairs fails, we'll come back during phase 7.
	 */
	scrub_item_init_fs(&sri);
	scrub_item_schedule(&sri, XFS_SCRUB_TYPE_FSCOUNTERS);

and:

	/*
	 * Try to fix the quota usage counts so that online repair
	 * doesn't fail with EDQUOT (or worse shut down the fs) due to
	 * bad counts.
	 */
	if (fsgeom.sick & XFS_FSOP_GEOM_SICK_QUOTACHECK)
		scrub_item_schedule(&sri, XFS_SCRUB_TYPE_QUOTACHECK);

phase4_estimate:

	/*
	 * fscounters and quotacheck are run directly by phase4_func
	 * independent of the repair lists, so put that in the item
	 * count.  See phase4_func for why.
	 */
	if (need_fixing)
		need_fixing += 2;

How does that sound?

--D

  reply	other threads:[~2026-06-26 16:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 22:54 [PATCHSET] xfs_scrub: codex-inspired bug fixes, part 3 Darrick J. Wong
2026-06-25 22:54 ` [PATCH 1/8] xfs_scrub: stop user file scan if caller already aborte Darrick J. Wong
2026-06-26  4:58   ` Christoph Hellwig
2026-06-26 16:46     ` Darrick J. Wong
2026-06-25 22:54 ` [PATCH 2/8] xfs_scrub: don't flatten error numbers in read_verify_schedule_now Darrick J. Wong
2026-06-26  4:58   ` Christoph Hellwig
2026-06-25 22:54 ` [PATCH 3/8] xfs_scrub: actually handle NEEDSCHECK scrub items in phase 4 Darrick J. Wong
2026-06-26  4:59   ` Christoph Hellwig
2026-06-25 22:55 ` [PATCH 4/8] xfs_scrub: fix spacemap external log device scan dev key Darrick J. Wong
2026-06-26  5:03   ` Christoph Hellwig
2026-06-26 17:09     ` Darrick J. Wong
2026-06-25 22:55 ` [PATCH 5/8] xfs_scrub: fix estimate of work items for phase 4 Darrick J. Wong
2026-06-26  5:04   ` Christoph Hellwig
2026-06-26 16:55     ` Darrick J. Wong [this message]
2026-06-25 22:55 ` [PATCH 6/8] xfs_scrub: don't leak phase 5 scan items after a failed workqueue_add Darrick J. Wong
2026-06-26  5:04   ` Christoph Hellwig
2026-06-25 22:56 ` [PATCH 7/8] xfs_scrub: fix phase 8 debug reporting Darrick J. Wong
2026-06-26  5:05   ` Christoph Hellwig
2026-06-25 22:56 ` [PATCH 8/8] xfs_scrub: always finish cleanup, even if reporting healthy state fails Darrick J. Wong
2026-06-26  5:05   ` 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=20260626165525.GY6078@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@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