Commit 426245a4 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging: lustre: lmv: release request in lmv_revalidate_slaves()

In lmv_revalidate_slaves() ensure that the request returned by
md_intent_lock() is properly released on all paths.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5452
Reviewed-on: http://review.whamcloud.com/11326Reviewed-by: default avatarwang di <di.wang@intel.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@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 9e2c96eb
...@@ -155,6 +155,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody, ...@@ -155,6 +155,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody,
{ {
struct obd_device *obd = exp->exp_obd; struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv; struct lmv_obd *lmv = &obd->u.lmv;
struct ptlrpc_request *req = NULL;
struct mdt_body *body; struct mdt_body *body;
struct md_op_data *op_data; struct md_op_data *op_data;
unsigned long size = 0; unsigned long size = 0;
...@@ -178,7 +179,6 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody, ...@@ -178,7 +179,6 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody,
*/ */
for (i = 0; i < lsm->lsm_md_stripe_count; i++) { for (i = 0; i < lsm->lsm_md_stripe_count; i++) {
struct lookup_intent it = { .it_op = IT_GETATTR }; struct lookup_intent it = { .it_op = IT_GETATTR };
struct ptlrpc_request *req = NULL;
struct lustre_handle *lockh = NULL; struct lustre_handle *lockh = NULL;
struct lmv_tgt_desc *tgt = NULL; struct lmv_tgt_desc *tgt = NULL;
struct inode *inode; struct inode *inode;
...@@ -205,6 +205,11 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody, ...@@ -205,6 +205,11 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody,
CDEBUG(D_INODE, "Revalidate slave "DFID" -> mds #%d\n", CDEBUG(D_INODE, "Revalidate slave "DFID" -> mds #%d\n",
PFID(&fid), tgt->ltd_idx); PFID(&fid), tgt->ltd_idx);
if (req) {
ptlrpc_req_finished(req);
req = NULL;
}
rc = md_intent_lock(tgt->ltd_exp, op_data, &it, &req, rc = md_intent_lock(tgt->ltd_exp, op_data, &it, &req,
cb_blocking, extra_lock_flags); cb_blocking, extra_lock_flags);
if (rc < 0) if (rc < 0)
...@@ -228,9 +233,6 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody, ...@@ -228,9 +233,6 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody,
PFID(&lsm->lsm_md_oinfo[i].lmo_fid), PFID(&lsm->lsm_md_oinfo[i].lmo_fid),
PFID(&lsm->lsm_md_oinfo[0].lmo_fid)); PFID(&lsm->lsm_md_oinfo[0].lmo_fid));
if (req)
ptlrpc_req_finished(req);
if (it.it_lock_mode && lockh) { if (it.it_lock_mode && lockh) {
ldlm_lock_decref(lockh, it.it_lock_mode); ldlm_lock_decref(lockh, it.it_lock_mode);
it.it_lock_mode = 0; it.it_lock_mode = 0;
...@@ -245,9 +247,6 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody, ...@@ -245,9 +247,6 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody,
LTIME_S(inode->i_atime) = body->mbo_atime; LTIME_S(inode->i_atime) = body->mbo_atime;
LTIME_S(inode->i_ctime) = body->mbo_ctime; LTIME_S(inode->i_ctime) = body->mbo_ctime;
LTIME_S(inode->i_mtime) = body->mbo_mtime; LTIME_S(inode->i_mtime) = body->mbo_mtime;
if (req)
ptlrpc_req_finished(req);
} }
md_set_lock_data(tgt->ltd_exp, lockh, inode, NULL); md_set_lock_data(tgt->ltd_exp, lockh, inode, NULL);
...@@ -288,6 +287,9 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody, ...@@ -288,6 +287,9 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody,
mbody->mbo_mtime = mtime; mbody->mbo_mtime = mtime;
} }
cleanup: cleanup:
if (req)
ptlrpc_req_finished(req);
kfree(op_data); kfree(op_data);
return rc; return rc;
} }
......
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