ceph: fix msgr to keep sent messages until acked
authorSage Weil <sage@newdream.net>
Sun, 14 Feb 2010 04:29:31 +0000 (20:29 -0800)
committerSage Weil <sage@newdream.net>
Sun, 14 Feb 2010 04:29:31 +0000 (20:29 -0800)
The test was backwards from commit b3d1dbbd: keep the message if the
connection _isn't_ lossy.  This allows the client to continue when the
TCP connection drops for some reason (network glitch) but both ends
survive.

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

index c4341784ec8f807b5ced19482799d45e3a37dd17..44bdaf4399245e90c82d603b64287b11dc55082e 100644 (file)
@@ -463,11 +463,11 @@ static void prepare_write_message(struct ceph_connection *con)
                       struct ceph_msg, list_head);
        con->out_msg = m;
        if (test_bit(LOSSYTX, &con->state)) {
+               list_del_init(&m->list_head);
+       } else {
                /* put message on sent list */
                ceph_msg_get(m);
                list_move_tail(&m->list_head, &con->out_sent);
-       } else {
-               list_del_init(&m->list_head);
        }
 
        m->hdr.seq = cpu_to_le64(++con->out_seq);