From 24451f379050373cb05ad1df7dd19134f21abba7 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Mon, 22 Jun 2020 21:04:34 +0300 Subject: [PATCH] LU-13600 ptlrpc: re-enterable signal_completed_replay() The signal_completed_replay() can meet race conditions while checking imp_replay_inflight counter, so remove assertion and check race conditions instead. Fixes: 3b613a442b ("LU-13600 ptlrpc: limit rate of lock replays") Signed-off-by: Mikhail Pershin Change-Id: Ib7c372b1757556b7285f380b40167742f9b71ec6 Reviewed-on: https://review.whamcloud.com/39140 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/ptlrpc/import.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 48493643..6221bbc 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1455,8 +1455,8 @@ static int signal_completed_replay(struct obd_import *imp) if (unlikely(OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_FINISH_REPLAY))) RETURN(0); - LASSERT(atomic_read(&imp->imp_replay_inflight) == 0); - atomic_inc(&imp->imp_replay_inflight); + if (!atomic_add_unless(&imp->imp_replay_inflight, 1, 1)) + RETURN(0); req = ptlrpc_request_alloc_pack(imp, &RQF_OBD_PING, LUSTRE_OBD_VERSION, OBD_PING); -- 1.8.3.1