summaryrefslogtreecommitdiffstats
path: root/sbin/fsck
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fsck')
-rw-r--r--sbin/fsck/dir.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/fsck/dir.c b/sbin/fsck/dir.c
index 888bad2..9a2b923 100644
--- a/sbin/fsck/dir.c
+++ b/sbin/fsck/dir.c
@@ -472,8 +472,18 @@ linkup(orphan, parentdir)
inodirty();
lncntp[lfdir]++;
pwarn("DIR I=%lu CONNECTED. ", orphan);
- if (parentdir != (ino_t)-1)
+ if (parentdir != (ino_t)-1) {
printf("PARENT WAS I=%lu\n", parentdir);
+ /*
+ * The parent directory, because of the ordering
+ * guarantees, has had the link count incremented
+ * for the child, but no entry was made. This
+ * fixes the parent link count so that fsck does
+ * not need to be rerun.
+ */
+ lncntp[parentdir]++;
+
+ }
if (preen == 0)
printf("\n");
}
OpenPOWER on IntegriCloud