Commit 1679f876 authored by Sage Weil's avatar Sage Weil

ceph: reset bits on connection close

Clear LOSSYTX bit, so that if/when we reconnect, said reconnect
will retry on failure.

Clear _PENDING bits too, to avoid polluting subsequent
connection state.

Drop unused REGISTERED bit.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 080af17e
...@@ -342,6 +342,9 @@ void ceph_con_close(struct ceph_connection *con) ...@@ -342,6 +342,9 @@ void ceph_con_close(struct ceph_connection *con)
dout("con_close %p peer %s\n", con, pr_addr(&con->peer_addr.in_addr)); dout("con_close %p peer %s\n", con, pr_addr(&con->peer_addr.in_addr));
set_bit(CLOSED, &con->state); /* in case there's queued work */ set_bit(CLOSED, &con->state); /* in case there's queued work */
clear_bit(STANDBY, &con->state); /* avoid connect_seq bump */ clear_bit(STANDBY, &con->state); /* avoid connect_seq bump */
clear_bit(LOSSYTX, &con->state); /* so we retry next connect */
clear_bit(KEEPALIVE_PENDING, &con->state);
clear_bit(WRITE_PENDING, &con->state);
mutex_lock(&con->mutex); mutex_lock(&con->mutex);
reset_connection(con); reset_connection(con);
cancel_delayed_work(&con->work); cancel_delayed_work(&con->work);
......
...@@ -119,7 +119,6 @@ struct ceph_msg_pos { ...@@ -119,7 +119,6 @@ struct ceph_msg_pos {
* state with the peer. */ * state with the peer. */
#define CLOSED 10 /* we've closed the connection */ #define CLOSED 10 /* we've closed the connection */
#define SOCK_CLOSED 11 /* socket state changed to closed */ #define SOCK_CLOSED 11 /* socket state changed to closed */
#define REGISTERED 12 /* connection appears in con_tree */
#define OPENING 13 /* open connection w/ (possibly new) peer */ #define OPENING 13 /* open connection w/ (possibly new) peer */
#define DEAD 14 /* dead, about to kfree */ #define DEAD 14 /* dead, about to kfree */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment