Blame SOURCES/xfsprogs-4.18-repair-root-parent.patch

89952e
xfs_repair: Fix root inode's parent when it's bogus for sf directory
89952e
89952e
Currently when root inode is in short-form and its parent ino
89952e
has an invalid value, process_sf_dir2() ends up not fixing it,
89952e
because if verify_inum() fails we never get to the next case which
89952e
would fix the root inode's parent pointer.
89952e
89952e
This behavior triggers the following assert on process_dir2():
89952e
89952e
   ASSERT((ino != mp->m_sb.sb_rootino && ino != *parent) ||
89952e
        (ino == mp->m_sb.sb_rootino &&
89952e
        (ino == *parent || need_root_dotdot == 1)));
89952e
89952e
This patch fixes this behavior by making sure we always properly
89952e
handle rootino parent pointer in process_sf_dir2()
89952e
89952e
Signed-off-by: Marco Benatto <mbenatto@redhat.com>
89952e
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
89952e
89952e
---
89952e
89952e
Note: reviewed but not yet merged upstream
89952e
89952e
 repair/dir2.c | 4 +++-
89952e
 1 file changed, 3 insertions(+), 1 deletion(-)
89952e
89952e
diff --git a/repair/dir2.c b/repair/dir2.c
89952e
index e162d2b..225f926 100644
89952e
--- a/repair/dir2.c
89952e
+++ b/repair/dir2.c
89952e
@@ -495,8 +495,10 @@ _("corrected entry offsets in directory %" PRIu64 "\n"),
89952e
 
89952e
 	/*
89952e
 	 * if parent entry is bogus, null it out.  we'll fix it later .
89952e
+	 * If the validation fails for the root inode we fix it in
89952e
+	 * the next else case.
89952e
 	 */
89952e
-	if (verify_inum(mp, *parent))  {
89952e
+	if (verify_inum(mp, *parent) && ino != mp->m_sb.sb_rootino)  {
89952e
 
89952e
 		do_warn(
89952e
 _("bogus .. inode number (%" PRIu64 ") in directory inode %" PRIu64 ", "),
89952e
-- 
89952e
2.9.5
89952e
89952e
--
89952e
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
89952e
the body of a message to majordomo@vger.kernel.org
89952e
More majordomo info at  http://vger.kernel.org/majordomo-info.html
89952e
89952e