From a6d9487cc2e5eb68101239da1554c6beeb02da86 Mon Sep 17 00:00:00 2001 From: yury Date: Sun, 24 Sep 2006 13:04:46 +0000 Subject: [PATCH] - in mdc_replay_open() do not assert on body == NULL, that is legal case when server fails to replay LDLM_ENQUEUE. --- lustre/mdc/mdc_request.c | 15 ++++++++++----- lustre/mdt/mdt_handler.c | 14 +++++++------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 21c2320..ed773ca 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -545,21 +545,23 @@ static void mdc_replay_open(struct ptlrpc_request *req) struct mdt_body *body; ENTRY; - body = lustre_swab_repbuf(req, DLM_REPLY_REC_OFF, sizeof(*body), - lustre_swab_mdt_body); - LASSERT(body != NULL); - if (mod == NULL) { DEBUG_REQ(D_ERROR, req, - "can't properly replay without open data"); + "Can't properly replay without open data."); EXIT; return; } + body = lustre_swab_repbuf(req, DLM_REPLY_REC_OFF, sizeof(*body), + lustre_swab_mdt_body); + och = mod->mod_och; if (och != NULL) { struct lustre_handle *file_fh; + LASSERT(och->och_magic == OBD_CLIENT_HANDLE_MAGIC); + LASSERT(body != NULL); + file_fh = &och->och_fh; CDEBUG(D_HA, "updating handle from "LPX64" to "LPX64"\n", file_fh->cookie, body->handle.cookie); @@ -570,7 +572,10 @@ static void mdc_replay_open(struct ptlrpc_request *req) close_req = mod->mod_close_req; if (close_req != NULL) { struct mdt_epoch *epoch; + LASSERT(lustre_msg_get_opc(close_req->rq_reqmsg) == MDS_CLOSE); + LASSERT(body != NULL); + epoch = lustre_msg_buf(close_req->rq_reqmsg, REQ_REC_OFF, sizeof(*epoch)); LASSERT(epoch); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 9bd4053..d6503ce 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -910,12 +910,6 @@ static int mdt_reint_internal(struct mdt_thread_info *info, int rc; ENTRY; - rc = mdt_reint_unpack(info, op); - if (rc != 0) { - CERROR("Can't unpack reint, rc %d\n", rc); - RETURN(rc); - } - /* pack reply */ if (req_capsule_has_field(pill, &RMF_MDT_MD, RCL_SERVER)) req_capsule_set_size(pill, &RMF_MDT_MD, RCL_SERVER, @@ -937,6 +931,12 @@ static int mdt_reint_internal(struct mdt_thread_info *info, if (MDT_FAIL_CHECK(OBD_FAIL_MDS_REINT_UNPACK)) RETURN(-EFAULT); + rc = mdt_reint_unpack(info, op); + if (rc != 0) { + CERROR("Can't unpack reint, rc %d\n", rc); + RETURN(rc); + } + if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) { struct mdt_client_data *mcd; @@ -1118,7 +1118,7 @@ static int mdt_enqueue(struct mdt_thread_info *info) */ LASSERT(info->mti_dlm_req != NULL); - if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_LDLM_ENQUEUE)) { + if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_ENQUEUE)) { info->mti_fail_id = OBD_FAIL_LDLM_ENQUEUE; return 0; } -- 1.8.3.1