From 5e33ea0a4448886a2f31df297fe1c7b3462cab75 Mon Sep 17 00:00:00 2001 From: yury Date: Mon, 25 Sep 2006 10:05:38 +0000 Subject: [PATCH] - fixed really nasty bug with recovery. Sometimes server sent _two_ replies for one replay RPC. And second replay was mostly empty, errorneous one which confused client some times. For instance mdc_replay_open() and others. In two words, mdt should not send anything and return with rc for cases mdt_recovery() (and thus mds_filter_recovery_request()) returns 0; - mor esimple recovery stuff in fld. --- lustre/fld/fld_handler.c | 12 +++--------- lustre/fld/fld_internal.h | 5 ----- lustre/mdt/mdt_handler.c | 13 ++++--------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index 319b957..3dd1803 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -146,14 +146,14 @@ static int fld_server_handle(struct lu_server_fld *fld, mf->mf_seq, mf->mf_mds); /* do not return -EEXIST error for resent case */ - if ((info->fti_flags & FLD_MSG_RESENT) && rc == -EEXIST) + if ((info->fti_flags & MSG_RESENT) && rc == -EEXIST) rc = 0; break; case FLD_DELETE: rc = fld_server_delete(fld, ctx, mf->mf_seq); /* do not return -ENOENT error for resent case */ - if ((info->fti_flags & FLD_MSG_RESENT) && rc == -ENOENT) + if ((info->fti_flags & MSG_RESENT) && rc == -ENOENT) rc = 0; break; case FLD_LOOKUP: @@ -194,12 +194,6 @@ static int fld_req_handle(struct ptlrpc_request *req, RETURN(-EPROTO); *out = *in; - if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) - info->fti_flags |= FLD_MSG_REPLAY; - - if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) - info->fti_flags |= FLD_MSG_RESENT; - rc = fld_server_handle(site->ls_server_fld, req->rq_svc_thread->t_ctx, *opc, out, info); @@ -214,7 +208,7 @@ static void fld_thread_info_init(struct ptlrpc_request *req, { int i; - info->fti_flags = 0; + info->fti_flags = lustre_msg_get_flags(req->rq_reqmsg); /* mark rep buffer as req-layout stuff expects */ for (i = 0; i < ARRAY_SIZE(info->fti_rep_buf_size); i++) diff --git a/lustre/fld/fld_internal.h b/lustre/fld/fld_internal.h index 0715ba4..db1e841 100644 --- a/lustre/fld/fld_internal.h +++ b/lustre/fld/fld_internal.h @@ -50,11 +50,6 @@ enum { extern struct lu_fld_hash fld_hash[]; -enum { - FLD_MSG_RESENT = 1 << 0, - FLD_MSG_REPLAY = 1 << 1 -}; - #ifdef __KERNEL__ struct fld_thread_info { struct req_capsule fti_pill; diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index b4fa7c2..b269625 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1705,9 +1705,8 @@ static int mdt_recovery(struct mdt_thread_info *info) int should_process; rc = mds_filter_recovery_request(req, obd, &should_process); - if (rc != 0 || !should_process) { + if (rc != 0 || !should_process) RETURN(rc); - } } RETURN(+1); } @@ -1757,19 +1756,15 @@ static int mdt_handle0(struct ptlrpc_request *req, rc = mds_msg_check_version(msg); if (rc == 0) { rc = mdt_recovery(info); - switch (rc) { - case +1: + if (rc == +1) { h = mdt_handler_find(lustre_msg_get_opc(msg), supported); - if (h != NULL) + if (h != NULL) { rc = mdt_req_handle(info, h, req); - else { + } else { req->rq_status = -ENOTSUPP; rc = ptlrpc_error(req); - break; } - /* fall through */ - case 0: rc = mdt_reply(req, rc, info); } } else -- 1.8.3.1