aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ceph/messenger.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 39653944f21b..56381b973d02 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -261,13 +261,8 @@ static void ceph_sock_state_change(struct sock *sk)
261 case TCP_CLOSE_WAIT: 261 case TCP_CLOSE_WAIT:
262 dout("%s TCP_CLOSE_WAIT\n", __func__); 262 dout("%s TCP_CLOSE_WAIT\n", __func__);
263 con_sock_state_closing(con); 263 con_sock_state_closing(con);
264 if (test_and_set_bit(SOCK_CLOSED, &con->flags) == 0) { 264 if (!test_and_set_bit(SOCK_CLOSED, &con->flags))
265 if (test_bit(CONNECTING, &con->state))
266 con->error_msg = "connection failed";
267 else
268 con->error_msg = "socket closed";
269 queue_con(con); 265 queue_con(con);
270 }
271 break; 266 break;
272 case TCP_ESTABLISHED: 267 case TCP_ESTABLISHED:
273 dout("%s TCP_ESTABLISHED\n", __func__); 268 dout("%s TCP_ESTABLISHED\n", __func__);
@@ -2187,6 +2182,14 @@ static void con_work(struct work_struct *work)
2187 2182
2188 mutex_lock(&con->mutex); 2183 mutex_lock(&con->mutex);
2189restart: 2184restart:
2185 if (test_and_clear_bit(SOCK_CLOSED, &con->flags)) {
2186 if (test_bit(CONNECTING, &con->state))
2187 con->error_msg = "connection failed";
2188 else
2189 con->error_msg = "socket closed";
2190 goto fault;
2191 }
2192
2190 if (test_and_clear_bit(BACKOFF, &con->flags)) { 2193 if (test_and_clear_bit(BACKOFF, &con->flags)) {
2191 dout("con_work %p backing off\n", con); 2194 dout("con_work %p backing off\n", con);
2192 if (queue_delayed_work(ceph_msgr_wq, &con->work, 2195 if (queue_delayed_work(ceph_msgr_wq, &con->work,
@@ -2216,9 +2219,6 @@ restart:
2216 con_close_socket(con); 2219 con_close_socket(con);
2217 } 2220 }
2218 2221
2219 if (test_and_clear_bit(SOCK_CLOSED, &con->flags))
2220 goto fault;
2221
2222 ret = try_read(con); 2222 ret = try_read(con);
2223 if (ret == -EAGAIN) 2223 if (ret == -EAGAIN)
2224 goto restart; 2224 goto restart;