Commit dd65d87a authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

net/smc: enable fallback for connection abort in state INIT

If a linkgroup is terminated abnormally already due to failing
LLC CONFIRM LINK or LLC ADD LINK, fallback to TCP is still possible.
In this case do not switch to state SMC_PEERABORTWAIT and do not set
sk_err.
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ca52fcf
...@@ -100,15 +100,14 @@ static void smc_close_active_abort(struct smc_sock *smc) ...@@ -100,15 +100,14 @@ static void smc_close_active_abort(struct smc_sock *smc)
struct smc_cdc_conn_state_flags *txflags = struct smc_cdc_conn_state_flags *txflags =
&smc->conn.local_tx_ctrl.conn_state_flags; &smc->conn.local_tx_ctrl.conn_state_flags;
sk->sk_err = ECONNABORTED; if (sk->sk_state != SMC_INIT && smc->clcsock && smc->clcsock->sk) {
if (smc->clcsock && smc->clcsock->sk) { sk->sk_err = ECONNABORTED;
smc->clcsock->sk->sk_err = ECONNABORTED; if (smc->clcsock && smc->clcsock->sk) {
smc->clcsock->sk->sk_state_change(smc->clcsock->sk); smc->clcsock->sk->sk_err = ECONNABORTED;
smc->clcsock->sk->sk_state_change(smc->clcsock->sk);
}
} }
switch (sk->sk_state) { switch (sk->sk_state) {
case SMC_INIT:
sk->sk_state = SMC_PEERABORTWAIT;
break;
case SMC_ACTIVE: case SMC_ACTIVE:
sk->sk_state = SMC_PEERABORTWAIT; sk->sk_state = SMC_PEERABORTWAIT;
release_sock(sk); release_sock(sk);
...@@ -143,6 +142,7 @@ static void smc_close_active_abort(struct smc_sock *smc) ...@@ -143,6 +142,7 @@ static void smc_close_active_abort(struct smc_sock *smc)
case SMC_PEERFINCLOSEWAIT: case SMC_PEERFINCLOSEWAIT:
sock_put(sk); /* passive closing */ sock_put(sk); /* passive closing */
break; break;
case SMC_INIT:
case SMC_PEERABORTWAIT: case SMC_PEERABORTWAIT:
case SMC_CLOSED: case SMC_CLOSED:
break; break;
......
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