Whamcloud - gitweb
- use req_xid_is_last()
authortappro <tappro>
Wed, 25 Oct 2006 10:37:59 +0000 (10:37 +0000)
committertappro <tappro>
Wed, 25 Oct 2006 10:37:59 +0000 (10:37 +0000)
- fix mdt_req_from_mcd() for MDS_DONE_WRITING

lustre/mdt/mdt_handler.c
lustre/mdt/mdt_recovery.c

index c5562c7..67df8f3 100644 (file)
@@ -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;
 
         /*
index 68c6169..8935545 100644 (file)
@@ -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);