linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Benatto <mbenatto@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Eric Sandeen <sandeen@sandeen.net>,
	linux-xfs@vger.kernel.org, Eric Sandeen <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 18:15:19 -0300	[thread overview]
Message-ID: <CAOGQQ2_LzWpCEHQ0qGreN-wOd2ccHiToeiXU3-a_08ps1FXiRg@mail.gmail.com> (raw)
In-Reply-To: <CAOGQQ28c_qfp6Mjt13v0jK7tYVuvL-1j+dbya6iRwUhqmfii8A@mail.gmail.com>

FYI,

just sent out "[PATCH] xfstests: Teste root inode parent pointer repairing"

On Fri, Jun 15, 2018 at 2:30 PM, Marco Benatto <mbenatto@redhat.com> wrote:
> On Thu, Jun 14, 2018 at 8:35 PM, Dave Chinner <david@fromorbit.com> wrote:
>> 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)?
>
> Sure, working on this. I'll send you once it's done.
>
>>
>> Cheers,
>>
>> Dave.
>> --
>> Dave Chinner
>> david@fromorbit.com
>
>
>
> Cheers,
>
> --
> Marco Benatto



-- 
Marco Benatto
Senior Software Maintenance Engineer | Red Hat Brasil
T: +55 11 35246161 | M: +55 41 9 88504051
Av. Brigadeiro Faria Lima 3900, 8° Andar. São Paulo, Brasil. RED HAT |
TRIED. TESTED. TRUSTED. Saiba porque em redhat.com

      reply	other threads:[~2018-06-15 21:15 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
2018-06-15 17:30     ` Marco Benatto
2018-06-15 21:15       ` Marco Benatto [this message]

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=CAOGQQ2_LzWpCEHQ0qGreN-wOd2ccHiToeiXU3-a_08ps1FXiRg@mail.gmail.com \
    --to=mbenatto@redhat.com \
    --cc=david@fromorbit.com \
    --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;
as well as URLs for NNTP newsgroup(s).