ceph: don't save sent messages on lossy connections
authorSage Weil <sage@newdream.net>
Mon, 14 Dec 2009 22:58:11 +0000 (14:58 -0800)
committerSage Weil <sage@newdream.net>
Tue, 22 Dec 2009 00:39:50 +0000 (16:39 -0800)
For lossy connections we drop all state on socket errors, so there is no
reason to keep sent ceph_msg's around.

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

index 986d8fb9c57408e2d7ae0f577e13350cfd1c7fb3..d5eef76a253ceb5d6c1347199974b8e96b9005f7 100644 (file)
@@ -453,12 +453,16 @@ static void prepare_write_message(struct ceph_connection *con)
                con->out_kvec_bytes = 1 + sizeof(con->out_temp_ack);
        }
 
-       /* move message to sending/sent list */
        m = list_first_entry(&con->out_queue,
                       struct ceph_msg, list_head);
        con->out_msg = m;
-       ceph_msg_get(m);
-       list_move_tail(&m->list_head, &con->out_sent);
+       if (test_bit(LOSSYTX, &con->state)) {
+               /* 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);
 
This page took 0.025933 seconds and 5 git commands to generate.