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

smc: cleanup close checking during data receival

When waiting for data to be received it must be checked if the
peer signals shutdown. The SMC code uses two different checks
for this purpose, even though just one check is sufficient.
This patch removes the superfluous test for SOCK_DONE.
Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4bd3e7fb
...@@ -65,7 +65,6 @@ static int smc_rx_wait_data(struct smc_sock *smc, long *timeo) ...@@ -65,7 +65,6 @@ static int smc_rx_wait_data(struct smc_sock *smc, long *timeo)
rc = sk_wait_event(sk, timeo, rc = sk_wait_event(sk, timeo,
sk->sk_err || sk->sk_err ||
sk->sk_shutdown & RCV_SHUTDOWN || sk->sk_shutdown & RCV_SHUTDOWN ||
sock_flag(sk, SOCK_DONE) ||
atomic_read(&conn->bytes_to_rcv) || atomic_read(&conn->bytes_to_rcv) ||
smc_cdc_rxed_any_close_or_senddone(conn), smc_cdc_rxed_any_close_or_senddone(conn),
&wait); &wait);
...@@ -116,7 +115,7 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, size_t len, ...@@ -116,7 +115,7 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, size_t len,
if (read_done) { if (read_done) {
if (sk->sk_err || if (sk->sk_err ||
sk->sk_state == SMC_CLOSED || sk->sk_state == SMC_CLOSED ||
(sk->sk_shutdown & RCV_SHUTDOWN) || sk->sk_shutdown & RCV_SHUTDOWN ||
!timeo || !timeo ||
signal_pending(current) || signal_pending(current) ||
smc_cdc_rxed_any_close_or_senddone(conn) || smc_cdc_rxed_any_close_or_senddone(conn) ||
...@@ -124,8 +123,6 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, size_t len, ...@@ -124,8 +123,6 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, size_t len,
peer_conn_abort) peer_conn_abort)
break; break;
} else { } else {
if (sock_flag(sk, SOCK_DONE))
break;
if (sk->sk_err) { if (sk->sk_err) {
read_done = sock_error(sk); read_done = sock_error(sk);
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