Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320297
b: refs/heads/master
c: e27947c
h: refs/heads/master
i:
  320295: a9d9564
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed Jul 6, 2012
1 parent 41c5e48 commit 806d985
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ec50d1868a9e0493046400bb1fdd054c7f64ebd
refs/heads/master: e27947c767f5bed15048f4e4dad3e2eb69133697
1 change: 1 addition & 0 deletions trunk/include/linux/ceph/messenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ struct ceph_msg_pos {
*/
#define CONNECTING 1
#define NEGOTIATING 2
#define CONNECTED 5
#define STANDBY 8 /* no outgoing messages, socket closed. we keep
* the ceph_connection around to maintain shared
* state with the peer. */
Expand Down
9 changes: 7 additions & 2 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ void ceph_con_close(struct ceph_connection *con)
ceph_pr_addr(&con->peer_addr.in_addr));
clear_bit(NEGOTIATING, &con->state);
clear_bit(CONNECTING, &con->state);
clear_bit(CONNECTED, &con->state);
clear_bit(STANDBY, &con->state); /* avoid connect_seq bump */
set_bit(CLOSED, &con->state);

Expand Down Expand Up @@ -1564,6 +1565,7 @@ static int process_connect(struct ceph_connection *con)
}
clear_bit(NEGOTIATING, &con->state);
clear_bit(CONNECTING, &con->state);
set_bit(CONNECTED, &con->state);
con->peer_global_seq = le32_to_cpu(con->in_reply.global_seq);
con->connect_seq++;
con->peer_features = server_feat;
Expand Down Expand Up @@ -2114,6 +2116,7 @@ static int try_read(struct ceph_connection *con)
prepare_read_ack(con);
break;
case CEPH_MSGR_TAG_CLOSE:
clear_bit(CONNECTED, &con->state);
set_bit(CLOSED, &con->state); /* fixme */
goto out;
default:
Expand Down Expand Up @@ -2190,11 +2193,13 @@ static void con_work(struct work_struct *work)
mutex_lock(&con->mutex);
restart:
if (test_and_clear_bit(SOCK_CLOSED, &con->flags)) {
if (test_and_clear_bit(CONNECTING, &con->state)) {
if (test_and_clear_bit(CONNECTED, &con->state))
con->error_msg = "socket closed";
else if (test_and_clear_bit(CONNECTING, &con->state)) {
clear_bit(NEGOTIATING, &con->state);
con->error_msg = "connection failed";
} else {
con->error_msg = "socket closed";
con->error_msg = "unrecognized con state";
}
goto fault;
}
Expand Down

0 comments on commit 806d985

Please sign in to comment.