Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/6] xfs_scrub: make phase 4 go straight to fstrim if nothing to fix
Date: Fri, 13 May 2022 08:32:24 -0700	[thread overview]
Message-ID: <Yn56CHxrxg05BdCx@magnolia> (raw)
In-Reply-To: <f97e6357-1973-6105-b450-b36d60dc4885@sandeen.net>

On Fri, May 13, 2022 at 08:18:15AM -0500, Eric Sandeen wrote:
> On 5/12/22 6:12 PM, Darrick J. Wong wrote:
> > On Thu, May 12, 2022 at 05:34:37PM -0500, Eric Sandeen wrote:
> >> On 5/5/22 11:08 AM, Darrick J. Wong wrote:
> >>> From: Darrick J. Wong <djwong@kernel.org>
> >>>
> >>> If there's nothing to repair in phase 4, there's no need to hold up the
> >>> FITRIM call to do the summary count scan that prepares us to repair
> >>> filesystem metadata.  Rearrange this a bit.
> >>>
> >>> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> >>
> >>
> >>> +
> >>> +	/*
> >>> +	 * If errors remain on the filesystem, do not trim anything.  We don't
> >>> +	 * have any threads running, so it's ok to skip the ctx lock here.
> >>> +	 */
> >>> +	if (ctx->corruptions_found || ctx->unfixable_errors == 0)
> >>> +		return 0;
> >>> +
> >>> +maybe_trim:
> >>> +	trim_filesystem(ctx);
> >>> +	return 0;
> >>>  }
> >>
> >> I'm a little confused by the unfixable_errors test, is that correct?
> >>
> >> Why do you bail out if there are 0 unfixable errors?
> > 
> > Oooops.  That was a logic inversion bug. :(
> 
> I'll fix it up and commit it with:
> 
> +	if (ctx->corruptions_found || ctx->unfixable_errors != 0)
> +		return 0;
> 
> if you want to confirm that's correct?

Yes, that's correct, thank you.

--D

> -Eric

  reply	other threads:[~2022-05-13 15:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 16:07 [PATCHSET 0/6] xfs_scrub: small performance tweaks Darrick J. Wong
2022-05-05 16:07 ` [PATCH 1/6] xfs_scrub: collapse trivial file scrub helpers Darrick J. Wong
2022-05-12 20:49   ` Eric Sandeen
2022-05-05 16:07 ` [PATCH 2/6] xfs_scrub: in phase 3, use the opened file descriptor for scrub calls Darrick J. Wong
2022-05-12 20:52   ` Eric Sandeen
2022-05-05 16:07 ` [PATCH 3/6] xfs_scrub: fall back to scrub-by-handle if opening handles fails Darrick J. Wong
2022-05-12 20:58   ` Eric Sandeen
2022-05-05 16:08 ` [PATCH 4/6] xfs_scrub: don't try any file repairs during phase 3 if AG metadata bad Darrick J. Wong
2022-05-12 21:02   ` Eric Sandeen
2022-05-05 16:08 ` [PATCH 5/6] xfs_scrub: make phase 4 go straight to fstrim if nothing to fix Darrick J. Wong
2022-05-12 22:34   ` Eric Sandeen
2022-05-12 23:12     ` Darrick J. Wong
2022-05-13 13:18       ` Eric Sandeen
2022-05-13 15:32         ` Darrick J. Wong [this message]
2022-05-05 16:08 ` [PATCH 6/6] xfs_scrub: in phase 3, use the opened file descriptor for repair calls Darrick J. Wong
2022-05-12 21:06   ` Eric Sandeen

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=Yn56CHxrxg05BdCx@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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