From 1602e88c088c8bf469ba2c98d4a8aa85c51a4350 Mon Sep 17 00:00:00 2001 From: tappro Date: Wed, 25 Oct 2006 10:37:59 +0000 Subject: [PATCH] - use req_xid_is_last() - fix mdt_req_from_mcd() for MDS_DONE_WRITING --- lustre/mdt/mdt_handler.c | 7 +++---- lustre/mdt/mdt_recovery.c | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index c5562c7..67df8f3 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1293,8 +1293,7 @@ static int mdt_reint_internal(struct mdt_thread_info *info, struct mdt_client_data *mcd; mcd = req->rq_export->exp_mdt_data.med_mcd; - if (mcd->mcd_last_xid == req->rq_xid || - mcd->mcd_last_close_xid == req->rq_xid) { + if (req_xid_is_last(req)) { mdt_reconstruct(info, lhc); rc = lustre_msg_get_status(req->rq_repmsg); GOTO(out, rc); @@ -1593,7 +1592,7 @@ int mdt_object_lock(struct mdt_thread_info *info, struct mdt_object *o, lh->mlh_pdo_mode = mdt_lock_pdo_mode(info, o, lh->mlh_reg_mode); if (lh->mlh_pdo_mode != LCK_MINMODE) { /* - * Do not use LDLM_FL_LOCAL_ONLY for paralell lock, it + * Do not use LDLM_FL_LOCAL_ONLY for parallel lock, it * is never going to be sent to client and we do not * want it slowed down due to possible cancels. */ @@ -1610,7 +1609,7 @@ int mdt_object_lock(struct mdt_thread_info *info, struct mdt_object *o, */ res_id->name[LUSTRE_RES_ID_HSH_OFF] = lh->mlh_pdo_hash; } - + policy->l_inodebits.bits = ibits; /* diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 68c6169..8935545 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -998,7 +998,8 @@ void mdt_req_from_mcd(struct ptlrpc_request *req, DEBUG_REQ(D_HA, req, "restoring transno "LPD64"/status %d", mcd->mcd_last_transno, mcd->mcd_last_result); - if (lustre_msg_get_opc(req->rq_reqmsg) == MDS_CLOSE) { + if (lustre_msg_get_opc(req->rq_reqmsg) == MDS_CLOSE || + lustre_msg_get_opc(req->rq_repmsg) == MDS_DONE_WRITING) { req->rq_transno = mcd->mcd_last_close_transno; req->rq_status = mcd->mcd_last_close_result; lustre_msg_set_transno(req->rq_repmsg, req->rq_transno); -- 1.8.3.1