]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: clean up keepalive send logic
authorSage Weil <sage@newdream.net>
Tue, 8 Sep 2009 20:55:23 +0000 (13:55 -0700)
committerSage Weil <sage@newdream.net>
Tue, 8 Sep 2009 20:55:23 +0000 (13:55 -0700)
src/kernel/messenger.c

index 9c8f8ac2fa37d55ad7bbf7b887f3e044a2f4e55e..22cfca4f4ac75d2408f9fb81f67beafe7f8d045d 100644 (file)
@@ -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);