summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/ptlrpc/import.c
diff options
context:
space:
mode:
authorMikhal Pershin <mike.pershin@intel.com>2016-12-02 19:53:25 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-12-06 10:56:29 +0100
commit29bdcd6725a88c267167066db33ae663ed568331 (patch)
treec7cc8c4d15a4afec84faacedf39859e2511d6536 /drivers/staging/lustre/lustre/ptlrpc/import.c
parent9fd14479a6d8dc22bb3802686a8a44cde1d4aae9 (diff)
staging: lustre: import: don't reconnect during connect interpret
The import connect flags might be cleared by ptlrpc_connect_import() wrongly if there is still connect interpret function is running. Use imp_connected boolean variable to indicate that we are still interpretting connect reply and don't try to reconnect until it ends. Signed-off-by: Mikhal Pershin <mike.pershin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7558 Reviewed-on: http://review.whamcloud.com/19312 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/import.c')
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/import.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c
index 66f5b4945e1b..e8280194001c 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/import.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/import.c
@@ -622,7 +622,8 @@ int ptlrpc_connect_import(struct obd_import *imp)
spin_unlock(&imp->imp_lock);
CERROR("already connected\n");
return 0;
- } else if (imp->imp_state == LUSTRE_IMP_CONNECTING) {
+ } else if (imp->imp_state == LUSTRE_IMP_CONNECTING ||
+ imp->imp_connected) {
spin_unlock(&imp->imp_lock);
CERROR("already connecting\n");
return -EALREADY;
@@ -971,6 +972,13 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
ptlrpc_maybe_ping_import_soon(imp);
goto out;
}
+
+ /*
+ * LU-7558: indicate that we are interpretting connect reply,
+ * pltrpc_connect_import() will not try to reconnect until
+ * interpret will finish.
+ */
+ imp->imp_connected = 1;
spin_unlock(&imp->imp_lock);
LASSERT(imp->imp_conn_current);
@@ -1194,12 +1202,18 @@ finish:
obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid);
ptlrpc_connect_import(imp);
+ spin_lock(&imp->imp_lock);
+ imp->imp_connected = 0;
imp->imp_connect_tried = 1;
+ spin_unlock(&imp->imp_lock);
return 0;
}
out:
+ spin_lock(&imp->imp_lock);
+ imp->imp_connected = 0;
imp->imp_connect_tried = 1;
+ spin_unlock(&imp->imp_lock);
if (rc != 0) {
IMPORT_SET_STATE(imp, LUSTRE_IMP_DISCON);