From ea8d2ecc783fbaff12c581935ac426b9b8567031 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 11 Feb 2020 00:06:07 +0300 Subject: [PATCH] LU-11269 ptlrpc: do not expose transient IDLE state to avoid cases when anyone sending an RPC observes the connection in this state while it's going to reconnect right away. Signed-off-by: Alex Zhuravlev Change-Id: I9ca89051c4176fe321262f8b2f52969c382e401e Reviewed-on: https://review.whamcloud.com/37523 Reviewed-by: Mike Pershin Reviewed-by: James Simmons Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/ptlrpc/import.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 4b4bcab..b1e32cb 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1777,7 +1777,6 @@ static int ptlrpc_disconnect_idle_interpret(const struct lu_env *env, imp->imp_state != LUSTRE_IMP_CLOSED) { LASSERTF(imp->imp_state == LUSTRE_IMP_CONNECTING, "%s\n", ptlrpc_import_state_name(imp->imp_state)); - imp->imp_state = LUSTRE_IMP_IDLE; memset(&imp->imp_remote_handle, 0, sizeof(imp->imp_remote_handle)); /* take our DISCONNECT into account */ @@ -1787,6 +1786,9 @@ static int ptlrpc_disconnect_idle_interpret(const struct lu_env *env, import_set_state_nolock(imp, LUSTRE_IMP_NEW); ptlrpc_reset_reqs_generation(imp); connect = 1; + } else { + /* do not expose transient IDLE state */ + import_set_state_nolock(imp, LUSTRE_IMP_IDLE); } } -- 1.8.3.1