]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: lustre: lmv: add testing for bad name hash
authorFan Yong <fan.yong@intel.com>
Sun, 18 Sep 2016 20:37:51 +0000 (16:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Sep 2016 07:44:03 +0000 (09:44 +0200)
Enable testing of the lfsck recovery feature in the
client code for the case when name hash for some
entry becomes corrupt.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5519
Reviewed-on: http://review.whamcloud.com/11846
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd_support.h
drivers/staging/lustre/lustre/lmv/lmv_obd.c

index d4c41d058218383773136dd35f29d170d54dc012..3144cca3d5bf28d2a7016890fc14e08e13f71659 100644 (file)
@@ -479,6 +479,7 @@ extern char obd_jobid_var[];
 #define OBD_FAIL_LFSCK_NO_AUTO         0x160b
 #define OBD_FAIL_LFSCK_NO_DOUBLESCAN   0x160c
 #define OBD_FAIL_LFSCK_INVALID_PFID    0x1619
+#define OBD_FAIL_LFSCK_BAD_NAME_HASH   0x1628
 
 /* UPDATE */
 #define OBD_FAIL_UPDATE_OBJ_NET                        0x1700
index 618af3322bf81a9093429337c417f3aff23b9da9..0ffb653eb074c85edbdf71a601daeeb9270ebc6f 100644 (file)
@@ -1573,9 +1573,13 @@ lmv_locate_target_for_name(struct lmv_obd *lmv, struct lmv_stripe_md *lsm,
        const struct lmv_oinfo *oinfo;
        struct lmv_tgt_desc *tgt;
 
-       oinfo = lsm_name_to_stripe_info(lsm, name, namelen);
-       if (IS_ERR(oinfo))
-               return ERR_CAST(oinfo);
+       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_NAME_HASH)) {
+               oinfo = &lsm->lsm_md_oinfo[cfs_fail_val];
+       } else {
+               oinfo = lsm_name_to_stripe_info(lsm, name, namelen);
+               if (IS_ERR(oinfo))
+                       return ERR_CAST(oinfo);
+       }
 
        *fid = oinfo->lmo_fid;
        *mds = oinfo->lmo_mds;