Whamcloud - gitweb
LU-4788 lfsck: verify .lustre/lost+found at the LFSCK start
[fs/lustre-release.git] / lustre / lfsck / lfsck_engine.c
index 663f9e1..39a0b3c 100644 (file)
@@ -821,6 +821,21 @@ int lfsck_master_engine(void *args)
        int                       rc;
        ENTRY;
 
+       if (lfsck->li_master &&
+           (!list_empty(&lfsck->li_list_scan) ||
+            !list_empty(&lfsck->li_list_double_scan))) {
+               rc = lfsck_verify_lpf(env, lfsck);
+               /* Fail to verify the .lustre/lost+found/MDTxxxx/ may be not
+                * fatal, because the .lustre/lost+found/ maybe not accessed
+                * by the LFSCK if it does not add orphans or others to such
+                * directory. So go ahead until hit failure when really uses
+                * the directory. */
+               if (rc != 0)
+                       CDEBUG(D_LFSCK, "%s: master engine fail to verify the "
+                              ".lustre/lost+found/, go ahead: rc = %d\n",
+                              lfsck_lfsck2name(lfsck), rc);
+       }
+
        oit_di = oit_iops->init(env, oit_obj, lfsck->li_args_oit, BYPASS_CAPA);
        if (IS_ERR(oit_di)) {
                rc = PTR_ERR(oit_di);