summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ceph/messenger.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index beee382d784e..500207bad5d6 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1562,6 +1562,7 @@ static int process_connect(struct ceph_connection *con)
fail_protocol(con);
return -1;
}
+ clear_bit(NEGOTIATING, &con->state);
clear_bit(CONNECTING, &con->state);
con->peer_global_seq = le32_to_cpu(con->in_reply.global_seq);
con->connect_seq++;
@@ -1951,7 +1952,6 @@ more:
/* open the socket first? */
if (con->sock == NULL) {
- clear_bit(NEGOTIATING, &con->state);
set_bit(CONNECTING, &con->state);
con_out_kvec_reset(con);
@@ -2190,10 +2190,12 @@ static void con_work(struct work_struct *work)
mutex_lock(&con->mutex);
restart:
if (test_and_clear_bit(SOCK_CLOSED, &con->flags)) {
- if (test_and_clear_bit(CONNECTING, &con->state))
+ if (test_and_clear_bit(CONNECTING, &con->state)) {
+ clear_bit(NEGOTIATING, &con->state);
con->error_msg = "connection failed";
- else
+ } else {
con->error_msg = "socket closed";
+ }
goto fault;
}
OpenPOWER on IntegriCloud