Hi Brian,

Hmm, it's not immediately obvious what's wrong with that code, but it's 
only useful for debugging anyway, so I'll just rip it out.

Can you let me know if this fixes it for you?
sage



Subject: [PATCH] kclient: kill out_qlen

This is apparently buggy (not immediately obvious why) but it's
only really useful for debugging anyway (it makes it easier to
match up message sequence numbers).  Rip it out.
---
 src/kernel/messenger.c |   13 ++-----------
 src/kernel/messenger.h |    1 -
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/kernel/messenger.c b/src/kernel/messenger.c
index 4915042..14771e5 100644
--- a/src/kernel/messenger.c
+++ b/src/kernel/messenger.c
@@ -251,7 +251,6 @@ static void reset_connection(struct ceph_connection *con)
 
        con->connect_seq = 0;
        con->out_seq = 0;
-       con->out_qlen = 0;
        con->out_msg = NULL;
        con->in_seq = 0;
        mutex_unlock(&con->out_mutex);
@@ -396,9 +395,6 @@ static void prepare_write_message(struct ceph_connection 
*con)
        list_move_tail(&m->list_head, &con->out_sent);
        con->out_msg = m;   /* we don't bother taking a reference here. */
 
-       BUG_ON(!con->out_qlen);
-       con->out_qlen--;
-
        m->hdr.seq = cpu_to_le64(++con->out_seq);
 
        dout("prepare_write_message %p seq %lld type %d len %d+%d+%d %d pgs\n",
@@ -1658,9 +1654,7 @@ void ceph_con_send(struct ceph_connection *con, struct 
ceph_msg *msg)
        /* queue */
        mutex_lock(&con->out_mutex);
        list_add_tail(&msg->list_head, &con->out_queue);
-       con->out_qlen++;
-       dout("----- %p %llu to %s%lld %d=%s len %d+%d+%d -----\n", msg,
-            con->out_seq + con->out_qlen,
+       dout("----- %p to %s%lld %d=%s len %d+%d+%d -----\n", msg,
             ENTITY_NAME(con->peer_name), le16_to_cpu(msg->hdr.type),
             ceph_msg_type_name(le16_to_cpu(msg->hdr.type)),
             le32_to_cpu(msg->hdr.front_len),
@@ -1684,10 +1678,7 @@ void ceph_con_revoke(struct ceph_connection *con, struct 
ceph_msg *msg)
                dout("con_revoke %p msg %p\n", con, msg);
                list_del_init(&msg->list_head);
                ceph_msg_put(msg);
-               if (msg->hdr.seq == 0)
-                       con->out_qlen--;
-               else
-                       msg->hdr.seq = 0;
+               msg->hdr.seq = 0;
                if (con->out_msg == msg)
                        con->out_msg = NULL;
                if (con->out_kvec_is_msg) {
diff --git a/src/kernel/messenger.h b/src/kernel/messenger.h
index 613313a..55cd437 100644
--- a/src/kernel/messenger.h
+++ b/src/kernel/messenger.h
@@ -165,7 +165,6 @@ struct ceph_connection {
        struct mutex out_mutex;
        struct list_head out_queue;
        struct list_head out_sent;   /* sending or sent but unacked */
-       unsigned out_qlen;
        u64 out_seq;                 /* last message queued for send */
        u64 out_seq_sent;            /* last message sent */
        bool out_keepalive_pending;
-- 
1.5.6.5

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Ceph-devel mailing list
Ceph-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ceph-devel

Reply via email to