xfs
[Top] [All Lists]

[PATCH 11/13] xfs_repair: set *parent if process_dir2_data() fixes root

To: xfs@xxxxxxxxxxx
Subject: [PATCH 11/13] xfs_repair: set *parent if process_dir2_data() fixes root inode
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Tue, 17 Mar 2015 15:33:13 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1426624395-8258-1-git-send-email-sandeen@xxxxxxxxxx>
References: <1426624395-8258-1-git-send-email-sandeen@xxxxxxxxxx>
process_dir2_data() may fix the root dir's parent inode:

"bad .. entry in root directory inode 6912, was 7159: correcting"

But we don't update the *parent passed in in that case; this then leads to
an assert later in process_dir2:

xfs_repair: dir2.c:2039: process_dir2:
  Assertion `(ino != mp->m_sb.sb_rootino && ino != *parent) ||
  (ino == mp->m_sb.sb_rootino && (ino == *parent || need_root_dotdot == 1))'
  failed.

Updating the value of *parent when we fix the parent value resolves this
problem.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
---
 repair/dir2.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/repair/dir2.c b/repair/dir2.c
index b1816f4..9e6c67d 100644
--- a/repair/dir2.c
+++ b/repair/dir2.c
@@ -1407,6 +1407,7 @@ _("bad .. entry in root directory inode %" PRIu64 ", was 
%" PRIu64 ": "),
                                        } else {
                                                do_warn(_("would correct\n"));
                                        }
+                                       *parent = ino;
                                }
                        }
                        /*
-- 
1.7.1

<Prev in Thread] Current Thread [Next in Thread>