summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/dir_repair.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/scrub/dir_repair.c')
-rw-r--r--fs/xfs/scrub/dir_repair.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/xfs/scrub/dir_repair.c b/fs/xfs/scrub/dir_repair.c
index 641d0153f3a2..839d6030f8b4 100644
--- a/fs/xfs/scrub/dir_repair.c
+++ b/fs/xfs/scrub/dir_repair.c
@@ -1102,12 +1102,17 @@ xrep_dir_validate_parent(
/*
* If the directory salvage scan found no parent or found an obviously
- * incorrect parent, jump to the filesystem scan.
+ * incorrect parent, try asking the dcache for the parent.
+ *
+ * If the dcache doesn't know about a parent or the parent seems
+ * obviously incorrect, jump to the filesystem scan.
*
* Otherwise, if the alleged parent seems plausible, scan the directory
* to make sure it really points to us.
*/
if (!xrep_parent_acceptable(sc, rd->parent_ino))
+ rd->parent_ino = xrep_parent_check_dcache(sc->ip);
+ if (!xrep_parent_acceptable(sc, rd->parent_ino))
goto scan;
/*