diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 8d521219480674e7dce71e11cad889d001968347..fff55657e0da888cae09a61ec85b491bc1326614 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -987,14 +987,9 @@ static int conn_connect(struct drbd_tconn *tconn) } } - if (conn_request_state(tconn, NS(conn, C_WF_REPORT_PARAMS), CS_VERBOSE) < SS_SUCCESS) - return 0; - sock->sk->sk_sndtimeo = timeout; sock->sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT; - drbd_thread_start(&tconn->asender); - if (drbd_send_protocol(tconn) == -EOPNOTSUPP) return -1; @@ -1008,6 +1003,11 @@ static int conn_connect(struct drbd_tconn *tconn) } rcu_read_unlock(); + if (conn_request_state(tconn, NS(conn, C_WF_REPORT_PARAMS), CS_VERBOSE) < SS_SUCCESS) + return 0; + + drbd_thread_start(&tconn->asender); + return h; out_release_sockets: diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 1132d87fa2845890f4b640f05118c77a486fad38..ecc5e27616682ca99d426dd55d21730eed9fca44 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -1055,7 +1055,7 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, drbd_thread_stop_nowait(&mdev->tconn->receiver); /* Upon network failure, we need to restart the receiver. */ - if (os.conn > C_TEAR_DOWN && + if (os.conn > C_WF_CONNECTION && ns.conn <= C_TEAR_DOWN && ns.conn >= C_TIMEOUT) drbd_thread_restart_nowait(&mdev->tconn->receiver);