Whamcloud - gitweb
LU-9499 lfsck: set target bitmap properly 18/28518/2
authorFan Yong <fan.yong@intel.com>
Wed, 14 Jun 2017 07:48:56 +0000 (15:48 +0800)
committerJohn L. Hammond <john.hammond@intel.com>
Wed, 6 Sep 2017 16:31:38 +0000 (16:31 +0000)
If the notify from the peer server has LF_INCOMPLETE flags,
then record it in the target bitmap unconditionally to avoid
missing to update the bitmap for some corner cases.

This patch also addes more debug information when the LFSCK
updates the bitmap and handle double_scan_result.

Lustre-change: https://review.whamcloud.com/27632
Lustre-commit: 775780cb90ba6069aefc7063adfe6862b26ce935

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I3a6195136d608aa47e59e61f95c92978503e3a4b
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/28518
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_layout.c

index 3ab2472..61838f2 100644 (file)
@@ -1434,6 +1434,10 @@ static inline void lfsck_lad_set_bitmap(const struct lu_env *env,
 
                ns->ln_flags |= LF_INCOMPLETE;
        }
+
+       CDEBUG(D_LFSCK, "%s: %s LFSCK set bitmap (%p/%u) for idx %u\n",
+              lfsck_lfsck2name(com->lc_lfsck), lad->lad_name, bitmap,
+              bitmap->size, index);
 }
 
 static inline int lfsck_links_read(const struct lu_env *env,
index c445303..98360e1 100644 (file)
@@ -1441,6 +1441,9 @@ static int lfsck_layout_double_scan_result(const struct lu_env *env,
        struct lfsck_instance   *lfsck = com->lc_lfsck;
        struct lfsck_layout     *lo    = com->lc_file_ram;
 
+       CDEBUG(D_LFSCK, "%s: layout LFSCK double scan: rc = %d\n",
+              lfsck_lfsck2name(lfsck), rc);
+
        down_write(&com->lc_sem);
        lo->ll_run_time_phase2 += cfs_duration_sec(cfs_time_current() +
                                  HALF_SEC - com->lc_time_last_checkpoint);
@@ -1479,6 +1482,9 @@ static int lfsck_layout_double_scan_result(const struct lu_env *env,
        rc = lfsck_layout_store(env, com);
        up_write(&com->lc_sem);
 
+       CDEBUG(D_LFSCK, "%s: layout LFSCK double scan result %u: rc = %d\n",
+              lfsck_lfsck2name(lfsck), lo->ll_status, rc);
+
        return rc;
 }
 
@@ -6308,12 +6314,12 @@ static int lfsck_layout_master_in_notify(const struct lu_env *env,
                break;
        case LE_PHASE2_DONE:
                ltd->ltd_layout_done = 1;
-               if (!list_empty(&ltd->ltd_layout_list)) {
+               if (!list_empty(&ltd->ltd_layout_list))
                        list_del_init(&ltd->ltd_layout_list);
-                       if (lr->lr_flags2 & LF_INCOMPLETE) {
-                               lfsck_lad_set_bitmap(env, com, ltd->ltd_index);
-                               fail = true;
-                       }
+
+               if (lr->lr_flags2 & LF_INCOMPLETE) {
+                       lfsck_lad_set_bitmap(env, com, ltd->ltd_index);
+                       fail = true;
                }
 
                break;