diff options
author | Fan Yong <fan.yong@intel.com> | 2016-09-18 16:37:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-19 09:44:03 +0200 |
commit | 1ebfdcac07c223437383f52f7e9dbb8df440d62e (patch) | |
tree | 448d0865a606bb8b8165c0c9d577afc3b50e0d6b /drivers/staging/lustre/lustre/lmv/lmv_obd.c | |
parent | 7510c5ca70e3dc52a22f8ffd80c3bd5412c3704b (diff) |
staging: lustre: lmv: add testing for bad name hash
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>
Diffstat (limited to 'drivers/staging/lustre/lustre/lmv/lmv_obd.c')
-rw-r--r-- | drivers/staging/lustre/lustre/lmv/lmv_obd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 618af3322bf8..0ffb653eb074 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -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; |