summaryrefslogtreecommitdiffstats
path: root/fs/ceph/messenger.c
diff options
context:
space:
mode:
authorSage Weil2009-12-14 23:58:11 +0100
committerSage Weil2009-12-22 01:39:50 +0100
commitb3d1dbbdd5670d8a9fb01f7dfb1cac522ff6795a (patch)
treea76dec72d476fe9e46b02687283b9730e269d613 /fs/ceph/messenger.c
parentceph: detect lossy state of connection (diff)
downloadkernel-qcow2-linux-b3d1dbbdd5670d8a9fb01f7dfb1cac522ff6795a.tar.gz
kernel-qcow2-linux-b3d1dbbdd5670d8a9fb01f7dfb1cac522ff6795a.tar.xz
kernel-qcow2-linux-b3d1dbbdd5670d8a9fb01f7dfb1cac522ff6795a.zip
ceph: don't save sent messages on lossy connections
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>
Diffstat (limited to 'fs/ceph/messenger.c')
-rw-r--r--fs/ceph/messenger.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c
index 986d8fb9c574..d5eef76a253c 100644
--- a/fs/ceph/messenger.c
+++ b/fs/ceph/messenger.c
@@ -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);