linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Marco Benatto <mbenatto@redhat.com>,
	linux-xfs@vger.kernel.org, sandeen@redhat.com
Subject: Re: [PATCH] xfs_repair: Fix root inode's parent when it's bogus for sf directory
Date: Fri, 15 Jun 2018 09:35:51 +1000	[thread overview]
Message-ID: <20180614233551.GN10363@dastard> (raw)
In-Reply-To: <1ddae533-b040-fdba-4350-01b59d5ddcba@sandeen.net>

On Thu, Jun 14, 2018 at 05:20:56PM -0500, Eric Sandeen wrote:
> On 6/14/18 5:16 PM, Marco Benatto wrote:
> > Currently when root inode is in short-form and its parent ino
> > has an invalid value, process_sf_dir2() ends up not fixing it,
> > because if verify_inum() fails we never get to the next case which
> > would fix the root inode's parent pointer.
> > 
> > This behavior triggers the following assert on process_dir2():
> > 
> >    ASSERT((ino != mp->m_sb.sb_rootino && ino != *parent) ||
> >         (ino == mp->m_sb.sb_rootino &&
> >         (ino == *parent || need_root_dotdot == 1)));
> > 
> > This patch fixes this behavior by making sure we always properly
> > handle rootino parent pointer in process_sf_dir2()
> > 
> > Signed-off-by: Marco Benatto <mbenatto@redhat.com>
> 
> This looks correct to me, thanks.
> 
> FWIW the problem can be demonstrated by setting the root inode's
> parent to 0 on a freshly made fs:
> 
> # mkfs.xfs -f -dfile,name=fsfile,size=1g
> # xfs_db -x -c "sb 0" -c "addr rootino" -c "write u3.sfdir3.hdr.parent.i4 0" fsfile
> # xfs_repair fsfile

xfstest please (also to check that xfs_scrub detects it)?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-06-14 23:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 22:16 [PATCH] xfs_repair: Fix root inode's parent when it's bogus for sf directory Marco Benatto
2018-06-14 22:20 ` Eric Sandeen
2018-06-14 23:35   ` Dave Chinner [this message]
2018-06-15 17:30     ` Marco Benatto
2018-06-15 21:15       ` Marco Benatto

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=20180614233551.GN10363@dastard \
    --to=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mbenatto@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).