Commit 29bdcd67 authored by Mikhal Pershin's avatar Mikhal Pershin Committed by Greg Kroah-Hartman

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: default avatarMikhal Pershin <mike.pershin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7558
Reviewed-on: http://review.whamcloud.com/19312Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9fd14479
...@@ -299,7 +299,9 @@ struct obd_import { ...@@ -299,7 +299,9 @@ struct obd_import {
*/ */
imp_force_reconnect:1, imp_force_reconnect:1,
/* import has tried to connect with server */ /* import has tried to connect with server */
imp_connect_tried:1; imp_connect_tried:1,
/* connected but not FULL yet */
imp_connected:1;
__u32 imp_connect_op; __u32 imp_connect_op;
struct obd_connect_data imp_connect_data; struct obd_connect_data imp_connect_data;
__u64 imp_connect_flags_orig; __u64 imp_connect_flags_orig;
......
...@@ -622,7 +622,8 @@ int ptlrpc_connect_import(struct obd_import *imp) ...@@ -622,7 +622,8 @@ int ptlrpc_connect_import(struct obd_import *imp)
spin_unlock(&imp->imp_lock); spin_unlock(&imp->imp_lock);
CERROR("already connected\n"); CERROR("already connected\n");
return 0; 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); spin_unlock(&imp->imp_lock);
CERROR("already connecting\n"); CERROR("already connecting\n");
return -EALREADY; return -EALREADY;
...@@ -971,6 +972,13 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, ...@@ -971,6 +972,13 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
ptlrpc_maybe_ping_import_soon(imp); ptlrpc_maybe_ping_import_soon(imp);
goto out; 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); spin_unlock(&imp->imp_lock);
LASSERT(imp->imp_conn_current); LASSERT(imp->imp_conn_current);
...@@ -1194,12 +1202,18 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, ...@@ -1194,12 +1202,18 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
obd2cli_tgt(imp->imp_obd), obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid); imp->imp_connection->c_remote_uuid.uuid);
ptlrpc_connect_import(imp); ptlrpc_connect_import(imp);
spin_lock(&imp->imp_lock);
imp->imp_connected = 0;
imp->imp_connect_tried = 1; imp->imp_connect_tried = 1;
spin_unlock(&imp->imp_lock);
return 0; return 0;
} }
out: out:
spin_lock(&imp->imp_lock);
imp->imp_connected = 0;
imp->imp_connect_tried = 1; imp->imp_connect_tried = 1;
spin_unlock(&imp->imp_lock);
if (rc != 0) { if (rc != 0) {
IMPORT_SET_STATE(imp, LUSTRE_IMP_DISCON); IMPORT_SET_STATE(imp, LUSTRE_IMP_DISCON);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment