From 506995fad27e9a51394958853e7af38eec8662bb Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 22 Sep 2006 20:02:53 +0000 Subject: [PATCH] - fixed bug with handling replaying and resending FLD and SEQ RPCs. obd->obd_recovery_handler which is initialized in target_handle_connect() time should be aware of all requests types and act appropriate. --- lustre/mdt/mdt_handler.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 67aaa5b..03dcf77 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -124,6 +124,7 @@ static struct mdt_opc_slice mdt_fld_handlers[]; static struct mdt_device *mdt_dev(struct lu_device *d); static int mdt_regular_handle(struct ptlrpc_request *req); +static int mdt_recovery_handle(struct ptlrpc_request *req); static int mdt_unpack_req_pack_rep(struct mdt_thread_info *info, __u32 flags); static struct lu_object_operations mdt_obj_ops; @@ -622,7 +623,7 @@ static int mdt_connect(struct mdt_thread_info *info) struct ptlrpc_request *req; req = mdt_info_req(info); - rc = target_handle_connect(req, mdt_regular_handle); + rc = target_handle_connect(req, mdt_recovery_handle); if (rc == 0) { LASSERT(req->rq_export != NULL); info->mti_mdt = mdt_dev(req->rq_export->exp_obd->obd_lu_dev); @@ -1729,6 +1730,30 @@ static int mdt_handle_common(struct ptlrpc_request *req, RETURN(rc); } +/* + * This is called from recovery code as handler of _all_ RPC types, FLD and SEQ + * as well. + */ +static int mdt_recovery_handle(struct ptlrpc_request *req) +{ + int rc; + ENTRY; + + switch (lustre_msg_get_opc(req->rq_reqmsg)) { + case FLD_QUERY: + rc = mdt_handle_common(req, mdt_fld_handlers); + break; + case SEQ_QUERY: + rc = mdt_handle_common(req, mdt_seq_handlers); + break; + default: + rc = mdt_handle_common(req, mdt_regular_handlers); + break; + } + + RETURN(rc); +} + static int mdt_regular_handle(struct ptlrpc_request *req) { return mdt_handle_common(req, mdt_regular_handlers); -- 1.8.3.1