From: Sage Weil Date: Tue, 8 Sep 2009 20:55:23 +0000 (-0700) Subject: kclient: clean up keepalive send logic X-Git-Tag: v0.14~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=add1582b3e3217bc2bc8d3198ea1ff37d99f3aa8;p=ceph.git kclient: clean up keepalive send logic --- diff --git a/src/kernel/messenger.c b/src/kernel/messenger.c index 9c8f8ac2fa37..22cfca4f4ac7 100644 --- a/src/kernel/messenger.c +++ b/src/kernel/messenger.c @@ -1243,14 +1243,14 @@ more_kvec: spin_unlock(&con->out_queue_lock); goto more; } + if (test_and_clear_bit(KEEPALIVE_PENDING, &con->state)) { + prepare_write_keepalive(con); + spin_unlock(&con->out_queue_lock); + goto more; + } spin_unlock(&con->out_queue_lock); } - if (test_and_clear_bit(KEEPALIVE_PENDING, &con->state)) { - prepare_write_keepalive(con); - goto more_kvec; - } - /* Nothing to do! */ clear_bit(WRITE_PENDING, &con->state); dout("try_write nothing else to write.\n"); @@ -1493,7 +1493,7 @@ static void ceph_fault(struct ceph_connection *con) /* If there are no messages in the queue, place the connection * in a STANDBY state (i.e., don't try to reconnect just yet). */ spin_lock(&con->out_queue_lock); - if (list_empty(&con->out_queue)) { + if (list_empty(&con->out_queue) && !con->out_keepalive_pending) { dout("fault setting STANDBY\n"); set_bit(STANDBY, &con->state); spin_unlock(&con->out_queue_lock);