Whamcloud - gitweb
LU-6895 lfsck: not destroy directory when fix FID-in-dirent
[fs/lustre-release.git] / lustre / lfsck / lfsck_engine.c
index 72a0ef3..ba65343 100644 (file)
@@ -780,8 +780,7 @@ static int lfsck_master_dir_engine(const struct lu_env *env,
                                goto checkpoint;
                }
 
-               if (ent->lde_attrs & LUDA_IGNORE &&
-                   strcmp(ent->lde_name, dotdot) != 0)
+               if (ent->lde_attrs & LUDA_IGNORE)
                        goto checkpoint;
 
                /* skip dot entry. */
@@ -1381,7 +1380,7 @@ next:
                spin_lock(&ltds->ltd_lock);
                if (com->lc_type == LFSCK_TYPE_LAYOUT) {
                        cfs_foreach_bit(ltds->ltd_tgts_bitmap, idx) {
-                               ltd = LTD_TGT(ltds, idx);
+                               ltd = lfsck_ltd2tgt(ltds, idx);
                                LASSERT(ltd != NULL);
 
                                if (!list_empty(&ltd->ltd_layout_list))
@@ -1394,7 +1393,7 @@ next:
                        }
                } else {
                        cfs_foreach_bit(ltds->ltd_tgts_bitmap, idx) {
-                               ltd = LTD_TGT(ltds, idx);
+                               ltd = lfsck_ltd2tgt(ltds, idx);
                                LASSERT(ltd != NULL);
 
                                if (!list_empty(&ltd->ltd_namespace_list))
@@ -1694,6 +1693,9 @@ int lfsck_assistant_engine(void *args)
                        lad->lad_to_post = 0;
                        LASSERT(lad->lad_post_result > 0);
 
+                       /* Wakeup the master engine to go ahead. */
+                       wake_up_all(&mthread->t_ctl_waitq);
+
                        memset(lr, 0, sizeof(*lr));
                        lr->lr_event = LE_PHASE1_DONE;
                        lr->lr_status = lad->lad_post_result;
@@ -1703,9 +1705,6 @@ int lfsck_assistant_engine(void *args)
                               "others for %s post: rc = %d\n",
                               lfsck_lfsck2name(lfsck),
                               lad->lad_name, rc);
-
-                       /* Wakeup the master engine to go ahead. */
-                       wake_up_all(&mthread->t_ctl_waitq);
                }
 
                if (lad->lad_to_double_scan) {