aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r--net/ceph/messenger.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 9aaf539942ac..1a3cb4a4f180 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2441,12 +2441,10 @@ static void clear_standby(struct ceph_connection *con)
2441{ 2441{
2442 /* come back from STANDBY? */ 2442 /* come back from STANDBY? */
2443 if (test_and_clear_bit(STANDBY, &con->state)) { 2443 if (test_and_clear_bit(STANDBY, &con->state)) {
2444 mutex_lock(&con->mutex);
2445 dout("clear_standby %p and ++connect_seq\n", con); 2444 dout("clear_standby %p and ++connect_seq\n", con);
2446 con->connect_seq++; 2445 con->connect_seq++;
2447 WARN_ON(test_bit(WRITE_PENDING, &con->flags)); 2446 WARN_ON(test_bit(WRITE_PENDING, &con->flags));
2448 WARN_ON(test_bit(KEEPALIVE_PENDING, &con->flags)); 2447 WARN_ON(test_bit(KEEPALIVE_PENDING, &con->flags));
2449 mutex_unlock(&con->mutex);
2450 } 2448 }
2451} 2449}
2452 2450
@@ -2483,11 +2481,12 @@ void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg)
2483 le32_to_cpu(msg->hdr.front_len), 2481 le32_to_cpu(msg->hdr.front_len),
2484 le32_to_cpu(msg->hdr.middle_len), 2482 le32_to_cpu(msg->hdr.middle_len),
2485 le32_to_cpu(msg->hdr.data_len)); 2483 le32_to_cpu(msg->hdr.data_len));
2484
2485 clear_standby(con);
2486 mutex_unlock(&con->mutex); 2486 mutex_unlock(&con->mutex);
2487 2487
2488 /* if there wasn't anything waiting to send before, queue 2488 /* if there wasn't anything waiting to send before, queue
2489 * new work */ 2489 * new work */
2490 clear_standby(con);
2491 if (test_and_set_bit(WRITE_PENDING, &con->flags) == 0) 2490 if (test_and_set_bit(WRITE_PENDING, &con->flags) == 0)
2492 queue_con(con); 2491 queue_con(con);
2493} 2492}
@@ -2574,7 +2573,9 @@ void ceph_msg_revoke_incoming(struct ceph_msg *msg)
2574void ceph_con_keepalive(struct ceph_connection *con) 2573void ceph_con_keepalive(struct ceph_connection *con)
2575{ 2574{
2576 dout("con_keepalive %p\n", con); 2575 dout("con_keepalive %p\n", con);
2576 mutex_lock(&con->mutex);
2577 clear_standby(con); 2577 clear_standby(con);
2578 mutex_unlock(&con->mutex);
2578 if (test_and_set_bit(KEEPALIVE_PENDING, &con->flags) == 0 && 2579 if (test_and_set_bit(KEEPALIVE_PENDING, &con->flags) == 0 &&
2579 test_and_set_bit(WRITE_PENDING, &con->flags) == 0) 2580 test_and_set_bit(WRITE_PENDING, &con->flags) == 0)
2580 queue_con(con); 2581 queue_con(con);