Skip to content

Commit

Permalink
ceph: detect lossy state of connection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sage Weil committed Dec 22, 2009
1 parent 5e095e8 commit 92ac41d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,6 @@ static void prepare_write_connect(struct ceph_messenger *msgr,
con->out_connect.global_seq = cpu_to_le32(global_seq);
con->out_connect.protocol_version = cpu_to_le32(proto);
con->out_connect.flags = 0;
if (test_bit(LOSSYTX, &con->state))
con->out_connect.flags = CEPH_MSG_CONNECT_LOSSY;

if (!after_banner) {
con->out_kvec_left = 0;
Expand Down Expand Up @@ -1168,6 +1166,10 @@ static int process_connect(struct ceph_connection *con)
con->connect_seq);
WARN_ON(con->connect_seq !=
le32_to_cpu(con->in_reply.connect_seq));

if (con->in_reply.flags & CEPH_MSG_CONNECT_LOSSY)
set_bit(LOSSYTX, &con->state);

prepare_read_tag(con);
break;

Expand Down

0 comments on commit 92ac41d

Please sign in to comment.