]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: Fix root inode's parent when it's bogus for sf directory
authorMarco Benatto <mbenatto@redhat.com>
Fri, 22 Jun 2018 00:46:24 +0000 (19:46 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 22 Jun 2018 00:46:24 +0000 (19:46 -0500)
commit77b3425e3bee68e92eabdd1d01bc26853acc22b9
treea78c565ebe476b4efa3da6be0d2b08f109f8e8e6
parentcb1b013b265e0e4f13b7a2d2a06dbd39091cc05f
xfs_repair: Fix root inode's parent when it's bogus for sf directory

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>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/dir2.c