public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/4] xfs: don't return -EFSCORRUPTED from repair when resources cannot be grabbed
Date: Fri, 14 Oct 2022 14:44:36 -0700	[thread overview]
Message-ID: <Y0nYRDC7TWN7+uGg@magnolia> (raw)
In-Reply-To: <20221013224911.GH3600936@dread.disaster.area>

On Fri, Oct 14, 2022 at 09:49:11AM +1100, Dave Chinner wrote:
> On Sun, Oct 02, 2022 at 11:19:55AM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > If we tried to repair something but the repair failed with -EDEADLOCK or
> > -EAGAIN, that means that the repair function couldn't grab some resource
> 
> Nothing should fail with EAGAIN by this point?

Right.

> > it needed and wants us to try again.  If we try again (with TRY_HARDER)
> > but still can't do it, exit back to userspace, since xfs_scrub_metadata
> > requires xrep_attempt to return -EAGAIN.
> 
> -EDEADLOCK, not -EAGAIN?

That part of the message confused me too.

How about this revision?

"If we tried to repair something but the repair failed with -EDEADLOCK,
that means that the repair function couldn't grab some resource it
needed and wants us to try again.  If we try again (with TRY_HARDER) but
still can't get all the resources we need, the repair fails and errors
remain on the filesystem.

"Right now, repair returns the -EDEADLOCK to the caller, which passes it
up to userspace without copying the xfs_scrub_metadata structure back to
userspace.  This is very confusing for userspace since xfs_scrub merely
reports "Resource deadlock would occur" and gives no indication that
there are uncorrected errors on the filesystem.  Hence we want to return
0 here so that the ioctl code copies the CORRUPTION flag back to
userspace."

Clearer, I hope?

--D

> 
> Confused.
> 
> -Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

  reply	other threads:[~2022-10-14 21:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 18:19 [PATCHSET v23.1 0/4] xfs: fix incorrect return values in online fsck Darrick J. Wong
2022-10-02 18:19 ` [PATCH 4/4] xfs: don't return -EFSCORRUPTED from repair when resources cannot be grabbed Darrick J. Wong
2022-10-13 22:49   ` Dave Chinner
2022-10-14 21:44     ` Darrick J. Wong [this message]
2022-11-04 20:35   ` [PATCH v23.2 " Darrick J. Wong
2022-11-08  1:27     ` Darrick J. Wong
2022-11-08  1:28   ` [PATCH v23.3 " Darrick J. Wong
2022-11-15  2:54     ` Dave Chinner
2022-10-02 18:19 ` [PATCH 1/4] xfs: return EINTR when a fatal signal terminates scrub Darrick J. Wong
2022-10-13 22:43   ` Dave Chinner
2022-10-02 18:19 ` [PATCH 2/4] xfs: fix return code when fatal signal encountered during dquot scrub Darrick J. Wong
2022-10-13 22:43   ` Dave Chinner
2022-10-02 18:19 ` [PATCH 3/4] xfs: don't retry repairs harder when EAGAIN is returned Darrick J. Wong
2022-10-13 22:46   ` Dave Chinner

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=Y0nYRDC7TWN7+uGg@magnolia \
    --to=djwong@kernel.org \
    --cc=david@fromorbit.com \
    --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