From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/4] repair: don't double check dir2 sf parent in phase 4
Date: Mon, 20 Jul 2020 17:55:08 -0700 [thread overview]
Message-ID: <20200721005508.GX3151642@magnolia> (raw)
In-Reply-To: <20200715140836.10197-3-bfoster@redhat.com>
On Wed, Jul 15, 2020 at 10:08:34AM -0400, Brian Foster wrote:
> The shortform parent ino verification code runs once in phase 3
> (ino_discovery == true) and once in phase 4 (ino_discovery ==
> false). This is unnecessary and leads to duplicate error messages if
> repair replaces an invalid parent value with zero because zero is
> still an invalid value. Skip the check in phase 4.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> ---
> repair/dir2.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/repair/dir2.c b/repair/dir2.c
> index cbbce601..caf6963d 100644
> --- a/repair/dir2.c
> +++ b/repair/dir2.c
> @@ -480,6 +480,9 @@ _("corrected entry offsets in directory %" PRIu64 "\n"),
> * check parent (..) entry
> */
> *parent = libxfs_dir2_sf_get_parent_ino(sfp);
> + if (!ino_discovery)
> + return 0;
I feel like this ought to have a comment explaining why we skip only the
parent check in phase 4:
/*
* If this function is called during inode discovery (phase 3), it will
* set a bad sf dir parent pointer to the root directory. This fixes
* the directory enough to pass the inode fork verifier in phase 6 when
* we try to reset the parent pointer to the correct value. There is no
* need to re-check the parent pointer during phase 4.
*/
With that added,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> +
>
> /*
> * if parent entry is bogus, null it out. we'll fix it later .
> --
> 2.21.3
>
next prev parent reply other threads:[~2020-07-21 0:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 14:08 [PATCH 0/4] xfsprogs: remove custom dir2 sf fork verifier from repair Brian Foster
2020-07-15 14:08 ` [PATCH 1/4] repair: set the in-core inode parent in phase 3 Brian Foster
2020-07-15 18:42 ` Christoph Hellwig
2020-07-21 0:57 ` Darrick J. Wong
2020-07-15 14:08 ` [PATCH 2/4] repair: don't double check dir2 sf parent in phase 4 Brian Foster
2020-07-15 18:43 ` Christoph Hellwig
2020-07-15 23:54 ` Darrick J. Wong
2020-07-16 10:39 ` Brian Foster
2020-07-21 0:55 ` Darrick J. Wong [this message]
2020-07-15 14:08 ` [PATCH 3/4] repair: use fs root ino for dummy parent value instead of zero Brian Foster
2020-07-15 18:44 ` Christoph Hellwig
2020-07-15 22:22 ` Dave Chinner
2020-07-16 10:41 ` Brian Foster
2020-07-16 22:06 ` Dave Chinner
2020-07-17 11:57 ` Brian Foster
2020-07-17 11:59 ` [PATCH v2] repair: use fs rootino " Brian Foster
2020-07-20 3:21 ` Dave Chinner
2020-07-21 0:47 ` Darrick J. Wong
2020-07-15 14:08 ` [PATCH 4/4] repair: remove custom dir2 sf fork verifier from phase6 Brian Foster
2020-07-15 18:44 ` Christoph Hellwig
2020-07-21 0:47 ` 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=20200721005508.GX3151642@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.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;
as well as URLs for NNTP newsgroup(s).