Commit 7da42db8 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging: lustre: hsm: prevent migration of HSM archived files

The reference copytool cannot handle migration of HSM archive
files. In the MDT migration path check for HSM attributes and fail if
they are present. In the LMV layer allow creation of volatile files
with any MDT index. Add a test to sanity-hsm to ensure that attempting
to migrate an HSM archive file is handled safely.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6866
Reviewed-on: http://review.whamcloud.com/17511Reviewed-by: default avatarwangdi <di.wang@intel.com>
Reviewed-by: default avatarAlex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 542c45ac
...@@ -1618,27 +1618,28 @@ lmv_locate_mds(struct lmv_obd *lmv, struct md_op_data *op_data, ...@@ -1618,27 +1618,28 @@ lmv_locate_mds(struct lmv_obd *lmv, struct md_op_data *op_data,
* ct_restore(). * ct_restore().
*/ */
if (op_data->op_bias & MDS_CREATE_VOLATILE && if (op_data->op_bias & MDS_CREATE_VOLATILE &&
(int)op_data->op_mds != -1 && lsm) { (int)op_data->op_mds != -1) {
int i; int i;
tgt = lmv_get_target(lmv, op_data->op_mds, NULL); tgt = lmv_get_target(lmv, op_data->op_mds, NULL);
if (IS_ERR(tgt)) if (IS_ERR(tgt))
return tgt; return tgt;
/* refill the right parent fid */ if (lsm) {
for (i = 0; i < lsm->lsm_md_stripe_count; i++) { /* refill the right parent fid */
struct lmv_oinfo *oinfo; for (i = 0; i < lsm->lsm_md_stripe_count; i++) {
struct lmv_oinfo *oinfo;
oinfo = &lsm->lsm_md_oinfo[i]; oinfo = &lsm->lsm_md_oinfo[i];
if (oinfo->lmo_mds == op_data->op_mds) { if (oinfo->lmo_mds == op_data->op_mds) {
*fid = oinfo->lmo_fid; *fid = oinfo->lmo_fid;
break; break;
}
} }
}
/* Hmm, can not find the stripe by mdt_index(op_mds) */ if (i == lsm->lsm_md_stripe_count)
if (i == lsm->lsm_md_stripe_count) *fid = lsm->lsm_md_oinfo[0].lmo_fid;
tgt = ERR_PTR(-EINVAL); }
return tgt; return tgt;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment