From: tappro Date: Thu, 12 Oct 2006 11:58:34 +0000 (+0000) Subject: - serialize done_writting with close requests X-Git-Tag: v1_8_0_110~486^2~587 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=20f02fe428aeb2238246f05e080ad3aa2b1c3676;p=fs%2Flustre-release.git - serialize done_writting with close requests - use 'close' fields in last_rcvd also for done_writting --- diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 2969af4..b49a71b 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -878,6 +878,7 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data, int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data, struct obd_client_handle *och) { + struct obd_device *obd = class_exp2obd(exp); struct ptlrpc_request *req; int size[4] = { sizeof(struct ptlrpc_body), sizeof(struct mdt_epoch), @@ -899,7 +900,9 @@ int mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data, mdc_close_pack(req, REQ_REC_OFF, op_data); ptlrpc_req_set_repsize(req, 2, repsize); + mdc_get_rpc_lock(obd->u.cli.cl_close_lock, NULL); rc = ptlrpc_queue_wait(req); + mdc_put_rpc_lock(obd->u.cli.cl_close_lock, NULL); ptlrpc_req_finished(req); RETURN(rc); } diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index e3041f7..0e963c1 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -784,7 +784,8 @@ static int mdt_last_rcvd_update(struct mdt_thread_info *mti, off = med->med_lr_off; mutex_down(&med->med_mcd_lock); - 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_reqmsg) == MDS_DONE_WRITING) { mcd->mcd_last_close_transno = mti->mti_transno; mcd->mcd_last_close_xid = req->rq_xid; mcd->mcd_last_close_result = rc;