From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Dave Chinner <david@fromorbit.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2 2/6] xfs_repair: don't error out on dirs with a single leafn block
Date: Wed, 5 Dec 2018 08:48:04 -0800 [thread overview]
Message-ID: <20181205164804.GK24487@magnolia> (raw)
In-Reply-To: <4580e90a-0040-6eb2-f499-7a45a6fe136c@sandeen.net>
On Tue, Dec 04, 2018 at 10:11:50PM -0600, Eric Sandeen wrote:
>
>
> On 12/4/18 9:48 PM, Eric Sandeen wrote:
> > On 11/22/18 12:13 PM, Darrick J. Wong wrote:
> >> From: Darrick J. Wong <darrick.wong@oracle.com>
> >>
> >> In process_node_dir2, we need to distinguish between a directory with a
> >> single leafn block (yes, they exist) having no interior da nodes, and a
> >> directory with a da tree that incorrectly points to dablk 0. If we
> >> happened to fill out any part of the da cursor then we have a da btree
> >> with garbage in it; otherwise, we have a single leafn block.
> >>
> >> This was found by repair repeatedly rebuilding a directory containing a
> >> single leafn block (xfs/495).
> >>
> >> Fixes: 67a79e2cc932 ("xfs_repair: treat zero da btree pointers as corruption")
> >> Reported-by: Dave Chinner <david@fromorbit.com>
> >> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > I'm finding the commit log hard to parse/understand.
> >
> > Let's reference
> >
> > 71a6af8 Revert "xfs_repair: treat zero da btree pointers as corruption"
> >
> > for starters, but can we do something like this....?
> >
> > ===
> >
> > As explained in
> >
> > 71a6af8 Revert "xfs_repair: treat zero da btree pointers as corruption"
> >
> > a single root LEAFN block can exist in a directory until it grows further.
> >
> > This is why, normally, we skip directories with a root marked
> > XFS_DIR2_LEAFN_MAGIC, as detected by the left-most leaf block being
> > found at file block 0.
> >
> > However, if we traversed any level of a btree to get here (as
> > indicated by da_cursor.active > 0), then a leaf block claiming block
> > 0 indicates corruption, and we should handle it as such, and rebuild
> > the directory.
> >
> > This was found by repair repeatedly rebuilding a directory containing a
> > single leafn block (xfs/495).
> >
> > Fixes: 67a79e2cc932 ("xfs_repair: treat zero da btree pointers as corruption")
> > Reported-by: Dave Chinner <david@fromorbit.com>
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > ===
> >
> > I'm not hung up on rewriting the commit log, but if you like it give me
> > thumbs up. I needed to think it through that way to grok the change.
> > Anyway, for the change now that I do grok it,
> >
> > Reviewed-by: Eric Sandeen <sandeen@redhat.com>
>
> Uh, the summary is wrong too, o? We /already/ "don't error out"
> on dirs with a single leafn block. Maybe:
>
> xfs_repair: rebuild directory when non-root leafn blocks claim block 0
>
> ?
Works for me. Want a resend or are you fixing it up on the way in?
--D
next prev parent reply other threads:[~2018-12-05 16:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-10 0:45 [PATCH 0/6] xfsprogs-4.20: various fixes Darrick J. Wong
2018-11-10 0:45 ` [PATCH 1/6] xfs_io.8: rearrange command listings by section Darrick J. Wong
2018-11-28 22:39 ` Eric Sandeen
2018-11-28 23:34 ` Darrick J. Wong
2018-11-28 23:46 ` Eric Sandeen
2018-12-05 3:21 ` [PATCH 1/6 V2] " Eric Sandeen
2018-12-05 17:56 ` Darrick J. Wong
2018-11-10 0:45 ` [PATCH 2/6] xfs_repair: don't error out on dirs with a single leafn block Darrick J. Wong
2018-11-22 18:13 ` [PATCH v2 " Darrick J. Wong
2018-12-05 3:48 ` Eric Sandeen
2018-12-05 4:11 ` Eric Sandeen
2018-12-05 16:48 ` Darrick J. Wong [this message]
2018-12-05 16:54 ` Eric Sandeen
2018-11-10 0:45 ` [PATCH 3/6] xfs_repair: skip block reservation when fixing freelist Darrick J. Wong
2018-11-10 7:22 ` Allison Henderson
2018-11-28 23:34 ` Eric Sandeen
2018-11-10 0:45 ` [PATCH 4/6] xfs_scrub: handle totally empty inode chunks Darrick J. Wong
2018-11-10 7:19 ` Allison Henderson
2018-11-29 0:16 ` Eric Sandeen
2018-11-29 0:35 ` Darrick J. Wong
2018-11-29 0:38 ` Eric Sandeen
2018-11-10 0:45 ` [PATCH 5/6] xfs_scrub: fix fractional reporting of single inodes Darrick J. Wong
2018-11-10 7:15 ` Allison Henderson
2018-11-10 17:52 ` Darrick J. Wong
2018-11-10 0:45 ` [PATCH 6/6] xfs_scrub: move everything to /usr/sbin Darrick J. Wong
2018-11-10 6:45 ` Allison Henderson
2018-11-10 8:43 ` L A Walsh
2018-11-10 18:06 ` Darrick J. Wong
2018-11-27 23:15 ` [PATCH 7/6] xfs_db: add missing string name for DBM_COWDATA Darrick J. Wong
2018-11-29 0:37 ` Eric Sandeen
2018-11-29 0:54 ` [PATCH v2 " Darrick J. Wong
2018-11-29 5:24 ` 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=20181205164804.GK24487@magnolia \
--to=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.