From 4f192768293364c65411015de7531f62fdfb754c Mon Sep 17 00:00:00 2001 From: Alexander Zarochentsev Date: Fri, 31 Jul 2020 19:01:32 +0300 Subject: [PATCH] LU-13899 tgt: drop old epoch request Do not send -ESTALE back to the client in case process_req_last_xid() detects an old epoch request. Just drop reply instead, otherwise -ESTALE may confuse the client and have it accept an error not attempting to resend the request. Fixes: c1d465de13 ("LU-6655 ptlrpc: skip delayed replay requests") HPE-bug-id: LUS-9097 Signed-off-by: Alexander Zarochentsev Change-Id: I1a9ebc637f1357ca0027adbb6bb706287f4b5f4f Reviewed-on: https://review.whamcloud.com/39612 Tested-by: jenkins Reviewed-by: Alexey Lyashkov Reviewed-by: Andrew Perepechko Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/target/tgt_handler.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 593fa72..83ecb5f 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -684,8 +684,15 @@ static int process_req_last_xid(struct ptlrpc_request *req) * replay request will have the larger xid than "exp_last_xid" */ if (req->rq_export->exp_conn_cnt > - lustre_msg_get_conn_cnt(req->rq_reqmsg)) + lustre_msg_get_conn_cnt(req->rq_reqmsg)) { + CDEBUG(D_RPCTRACE, + "Dropping request %llu from an old epoch %u/%u\n", + req->rq_xid, + lustre_msg_get_conn_cnt(req->rq_reqmsg), + req->rq_export->exp_conn_cnt); + req->rq_no_reply = 1; GOTO(out, rc = -ESTALE); + } /* try to release in-memory reply data */ if (tgt_is_multimodrpcs_client(exp)) { -- 1.8.3.1