public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs_repair: improve checking of existing rmap and refcount btrees
Date: Thu, 12 May 2022 13:54:13 -0700	[thread overview]
Message-ID: <20220512205413.GI27195@magnolia> (raw)
In-Reply-To: <8f1a6bf5-ad9a-7bbe-c038-2b9a7ba58a69@redhat.com>

On Thu, May 12, 2022 at 02:39:13PM -0500, Eric Sandeen wrote:
> On 5/5/22 11:05 AM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > There are a few deficiencies in the xfs_repair functions that check the
> > existing reverse mapping and reference count btrees.  First of all, we
> > don't report corruption or IO errors if we can't read the ondisk
> > metadata.  Second, we don't consistently warn if we cannot allocate
> > memory to perform the check.
> 
> Well, the caller used to report those, right? i.e.
> 
>         error = check_refcounts(wq->wq_ctx, agno);
>         if (error)
>                 do_error(
> _("%s while checking reference counts"),
>                          strerror(-error));
> 
> So I think this patch is just changing from reporting strerror(-error)
> when these things return, to hand-crafted error messages in the functions
> that get called?
> 
> AFAICT this patch changes
> 
> "Cannot allocate memory while checking reverse-mappings"
> to
> "Not enough memory to check reverse mappings"
> 
> etc.
> 
> Granted, strerror(EFSCORRUPTED) isn't very pretty, and your messages are
> probably more clear. But I just wanted to be sure I'm not missing something;
> I think every error is actually reported today, and this is just changing
> the error messages.

Yep, that's correct.  I guess I should have (re)written the commit
message like this:

"When we're checking the rmap and refcount btrees, push error reporting
down to the exact locations of failures so that the user sees both a
message specific to the failure that occurred and what repair was doing
at the time.  This also removes quite a bit of return code handling,
since all the errors were fatal anyway."

--D

> Thanks,
> -Eric
> 

  reply	other threads:[~2022-05-12 20:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 16:05 [PATCHSET 0/3] xfs_repair: various small fixes Darrick J. Wong
2022-05-05 16:05 ` [PATCH 1/3] xfs_repair: detect v5 featureset mismatches in secondary supers Darrick J. Wong
2022-05-12 19:02   ` Eric Sandeen
2022-05-12 19:13     ` Darrick J. Wong
2022-05-16  8:11       ` Dave Chinner
2022-05-16 17:59         ` Darrick J. Wong
2022-05-05 16:05 ` [PATCH 2/3] xfs_repair: improve checking of existing rmap and refcount btrees Darrick J. Wong
2022-05-12 19:39   ` Eric Sandeen
2022-05-12 20:54     ` Darrick J. Wong [this message]
2022-05-05 16:06 ` [PATCH 3/3] xfs_repair: check the ftype of dot and dotdot directory entries Darrick J. Wong
2022-05-12 20:36   ` Eric Sandeen
2022-05-16 18:11 ` [PATCH 4/3] xfs_repair: always rewrite secondary supers when needsrepair is set Darrick J. Wong

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=20220512205413.GI27195@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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