diff options
author | Sage Weil <sage@newdream.net> | 2009-12-14 17:58:11 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-12-21 19:39:50 -0500 |
commit | b3d1dbbdd5670d8a9fb01f7dfb1cac522ff6795a (patch) | |
tree | a76dec72d476fe9e46b02687283b9730e269d613 /fs/ceph/messenger.c | |
parent | 92ac41d0a4ab26fb68d3f841332e5d1f15d79123 (diff) |
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.c | 10 |
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) | |||
453 | con->out_kvec_bytes = 1 + sizeof(con->out_temp_ack); | 453 | con->out_kvec_bytes = 1 + sizeof(con->out_temp_ack); |
454 | } | 454 | } |
455 | 455 | ||
456 | /* move message to sending/sent list */ | ||
457 | m = list_first_entry(&con->out_queue, | 456 | m = list_first_entry(&con->out_queue, |
458 | struct ceph_msg, list_head); | 457 | struct ceph_msg, list_head); |
459 | con->out_msg = m; | 458 | con->out_msg = m; |
460 | ceph_msg_get(m); | 459 | if (test_bit(LOSSYTX, &con->state)) { |
461 | list_move_tail(&m->list_head, &con->out_sent); | 460 | /* put message on sent list */ |
461 | ceph_msg_get(m); | ||
462 | list_move_tail(&m->list_head, &con->out_sent); | ||
463 | } else { | ||
464 | list_del_init(&m->list_head); | ||
465 | } | ||
462 | 466 | ||
463 | m->hdr.seq = cpu_to_le64(++con->out_seq); | 467 | m->hdr.seq = cpu_to_le64(++con->out_seq); |
464 | 468 | ||