From 8867e6138c228cce89b94fb9415a2557f8e43ad6 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Mon, 1 Feb 2016 11:15:44 -0500 Subject: [PATCH] LU-7729 target: fix process_req_last_xid() return value process_req_last_xid() returns ptlrpc_error() on error, which actually returns 0 to caller mistankely. Test-Parameters: envdefinitions=ONLY=failover_ost \ clientcount=4 osscount=2 mdscount=2 mdtcount=1 \ austeroptions=-R failover=true iscsi=1 \ testlist=recovery-mds-scale Signed-off-by: Niu Yawei Change-Id: I136a8ef153a3ea08dcbf05e11fb412e31947be20 Reviewed-on: http://review.whamcloud.com/18245 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- lustre/target/tgt_handler.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index ac96517..d82ee10 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -634,10 +634,8 @@ static int process_req_last_xid(struct ptlrpc_request *req) * exp_last_xid on server; * - The former RPC got chance to be processed; */ - if (!(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)) { - req->rq_status = -EPROTO; - RETURN(ptlrpc_error(req)); - } + if (!(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)) + RETURN(-EPROTO); } /* try to release in-memory reply data */ @@ -732,8 +730,11 @@ int tgt_request_handle(struct ptlrpc_request *req) } else if (obd->obd_recovery_data.trd_processing_task != current_pid()) { rc = process_req_last_xid(req); - if (rc) + if (rc) { + req->rq_status = rc; + rc = ptlrpc_error(req); GOTO(out, rc); + } } request_fail_id = tgt->lut_request_fail_id; -- 1.8.3.1