public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v23.3 4/4] xfs: don't return -EFSCORRUPTED from repair when resources cannot be grabbed
Date: Tue, 15 Nov 2022 13:54:12 +1100	[thread overview]
Message-ID: <20221115025412.GT3600936@dread.disaster.area> (raw)
In-Reply-To: <Y2mwyQ8VD3zX4goX@magnolia>

On Mon, Nov 07, 2022 at 05:28:41PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> 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 as -EFSCORRUPTED,
> which results in XFS_SCRUB_OFLAG_CORRUPT being passed out to userspace.
> This is not correct because repair has not determined that anything is
> corrupt.  If the repair had been invoked on an object that could be
> optimized but wasn't corrupt (OFLAG_PREEN), the inability to grab
> resources will be reported to userspace as corrupt metadata, and users
> will be unnecessarily alarmed that their suboptimal metadata turned into
> a corruption.
> 
> Fix this by returning zero so that the results of the actual scrub will
> be copied back out to userspace.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> v23.3: fix vague wording of comment
> v23.2: fix the commit message to discuss what's really going on in this
> patch.
> ---
>  fs/xfs/scrub/repair.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-11-15  2:54 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
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 [this message]
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=20221115025412.GT3600936@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --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