Whamcloud - gitweb
LU-9499 lfsck: set target bitmap properly 32/27632/2
authorFan Yong <fan.yong@intel.com>
Wed, 14 Jun 2017 07:48:56 +0000 (15:48 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 13 Aug 2017 17:18:22 +0000 (17:18 +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.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I3a6195136d608aa47e59e61f95c92978503e3a4b
Reviewed-on: https://review.whamcloud.com/27632
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_layout.c

index ecb43f5..3b13041 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 3946d51..63868d5 100644 (file)
@@ -1440,6 +1440,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 += ktime_get_seconds() -
                                  com->lc_time_last_checkpoint;
@@ -1478,6 +1481,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;
 }
 
@@ -6302,12 +6308,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;