libceph: fix msgr keepalive flag
authorSage Weil <sage@newdream.net>
Thu, 3 Mar 2011 18:10:15 +0000 (10:10 -0800)
committerSage Weil <sage@newdream.net>
Fri, 4 Mar 2011 20:24:31 +0000 (12:24 -0800)
There was some broken keepalive code using a dead variable.  Shift to using
the proper bit flag.

Signed-off-by: Sage Weil <sage@newdream.net>
include/linux/ceph/messenger.h
net/ceph/messenger.c

index eb31e108a64df95dd63a090561cd3fb31fed4ead..31d91a64838be0326ee3d8d76032f67181008dbc 100644 (file)
@@ -161,7 +161,6 @@ struct ceph_connection {
        struct list_head out_queue;
        struct list_head out_sent;   /* sending or sent but unacked */
        u64 out_seq;                 /* last message queued for send */
-       bool out_keepalive_pending;
 
        u64 in_seq, in_seq_acked;  /* last message received, acked */
 
index 46fbc422ba74d6d670bc92c40f75f8d604fe0c3b..3252ea974e8fab509358f1018566d96773b96015 100644 (file)
@@ -336,7 +336,6 @@ static void reset_connection(struct ceph_connection *con)
                ceph_msg_put(con->out_msg);
                con->out_msg = NULL;
        }
-       con->out_keepalive_pending = false;
        con->in_seq = 0;
        con->in_seq_acked = 0;
 }
@@ -2019,10 +2018,10 @@ static void ceph_fault(struct ceph_connection *con)
        /* Requeue anything that hasn't been acked */
        list_splice_init(&con->out_sent, &con->out_queue);
 
-       /* If there are no messages in the queue, place the connection
-        * in a STANDBY state (i.e., don't try to reconnect just yet). */
-       if (list_empty(&con->out_queue) && !con->out_keepalive_pending) {
-               dout("fault setting STANDBY\n");
+       /* If there are no messages queued or keepalive pending, place
+        * the connection in a STANDBY state */
+       if (list_empty(&con->out_queue) &&
+           !test_bit(KEEPALIVE_PENDING, &con->state)) {
                set_bit(STANDBY, &con->state);
        } else {
                /* retry after a delay. */