From: Alex Zhuravlev Date: Mon, 10 Feb 2020 21:06:07 +0000 (+0300) Subject: LU-11269 ptlrpc: do not expose transient IDLE state X-Git-Tag: 2.12.5-RC1~71 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e668075a922a2a39247c00fe5f47d7a4368967f3;hp=46a42e5654643931b3e049674e9427554a0634f5;p=fs%2Flustre-release.git 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. Lustre-change: https://review.whamcloud.com/37523 Lustre-commit: ea8d2ecc783fbaff12c581935ac426b9b8567031 Signed-off-by: Alex Zhuravlev Change-Id: I9ca89051c4176fe321262f8b2f52969c382e401e Reviewed-by: Mike Pershin Reviewed-by: James Simmons Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/37649 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 4ccab0a..0e51a7e 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1759,7 +1759,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 */ @@ -1769,6 +1768,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); } }