aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/messenger.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-14 17:56:56 -0500
committerSage Weil <sage@newdream.net>2009-12-21 19:39:49 -0500
commit92ac41d0a4ab26fb68d3f841332e5d1f15d79123 (patch)
tree2dfc068efb3da472566b17d4587fe60c0b5e65cd /fs/ceph/messenger.c
parent5e095e8b40b0402ad3bcadc5b8d84c38b26c30b2 (diff)
ceph: detect lossy state of connection
The server indicates whether a connection is lossy; set our LOSSYTX bit appropriately. Do not set lossy bit on outgoing connections. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/messenger.c')
-rw-r--r--fs/ceph/messenger.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c
index 98519bd33f04..986d8fb9c574 100644
--- a/fs/ceph/messenger.c
+++ b/fs/ceph/messenger.c
@@ -625,8 +625,6 @@ static void prepare_write_connect(struct ceph_messenger *msgr,
625 con->out_connect.global_seq = cpu_to_le32(global_seq); 625 con->out_connect.global_seq = cpu_to_le32(global_seq);
626 con->out_connect.protocol_version = cpu_to_le32(proto); 626 con->out_connect.protocol_version = cpu_to_le32(proto);
627 con->out_connect.flags = 0; 627 con->out_connect.flags = 0;
628 if (test_bit(LOSSYTX, &con->state))
629 con->out_connect.flags = CEPH_MSG_CONNECT_LOSSY;
630 628
631 if (!after_banner) { 629 if (!after_banner) {
632 con->out_kvec_left = 0; 630 con->out_kvec_left = 0;
@@ -1168,6 +1166,10 @@ static int process_connect(struct ceph_connection *con)
1168 con->connect_seq); 1166 con->connect_seq);
1169 WARN_ON(con->connect_seq != 1167 WARN_ON(con->connect_seq !=
1170 le32_to_cpu(con->in_reply.connect_seq)); 1168 le32_to_cpu(con->in_reply.connect_seq));
1169
1170 if (con->in_reply.flags & CEPH_MSG_CONNECT_LOSSY)
1171 set_bit(LOSSYTX, &con->state);
1172
1171 prepare_read_tag(con); 1173 prepare_read_tag(con);
1172 break; 1174 break;
1173 1175