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);
}
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;
prepare_read_ack(con);
break;
case CEPH_MSGR_TAG_CLOSE:
+ clear_bit(CONNECTED, &con->state);
set_bit(CLOSED, &con->state); /* fixme */
goto out;
default:
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;
}