[PATCH 6/5] xfs_repair: don't re-add root dotdot if root dir was rebuilt

Eric Sandeen
2014-09-07T17:02:15Z

If we've rebuilt the root directory, ".." was taken
care of, so clear need_root_dotdot.

Otherwise it will be added twice, and a subsequent repair
will say:

entry ".." (ino 5824) in dir 5824 is a duplicate name, would junk entry

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

(sorry for 6/5, this just popped out and is similar to the
patch 3/5 I just sent, so probably worth doing at the same time.

diff --git a/repair/phase6.c b/repair/phase6.c
index cc36a9c..2e67c60 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -2294,6 +2297,9 @@ out_fix:
*/
if (*need_dot)
add_inode_ref(irec, ino_offset);
+ /* If we rebuilt the root dir, dot dot is in good shape */
+ if (ino == mp->m_sb.sb_rootino)
+ need_root_dotdot = 0;
*num_illegal = 0;
*need_dot = 0;
} else {