@@ -78,6 +78,7 @@
#define xfs_bmbt_get_all libxfs_bmbt_get_all
#define xfs_rtfree_extent libxfs_rtfree_extent
#define xfs_verify_rtbno libxfs_verify_rtbno
+#define xfs_verify_ino libxfs_verify_ino
#define xfs_zero_extent libxfs_zero_extent
#define xfs_defer_init libxfs_defer_init
@@ -847,6 +847,23 @@ _("bad .. entry in root directory inode %" PRIu64 ", was %" PRIu64 ": "),
}
*parent = ino;
}
+ /*
+ * Make sure our parent pointer doesn't point
+ * off into space.
+ */
+ if (!junkit &&
+ *parent != NULLFSINO &&
+ !libxfs_verify_ino(mp, *parent)) {
+ do_warn(
+_("bad .. entry in directory inode %" PRIu64 ", was %" PRIu64 ": "),
+ ino, *parent);
+ if (!no_modify) {
+ do_warn(_("correcting\n"));
+ } else {
+ do_warn(_("would correct\n"));
+ }
+ *parent = NULLFSINO;
+ }
}
/*
* Can't fix the directory unless we know which ..