mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-16 13:21:05 +00:00
smc: simplify abort logic
Some of the conditions to exit recv() are common in two pathes - cleaning up code by moving the check up so we have it only once. Signed-off-by: Stefan Raspl <raspl@linux.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>< Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a7b15ab887
commit
c8b8ec8e0d
1 changed files with 6 additions and 10 deletions
|
@ -112,26 +112,22 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, size_t len,
|
||||||
if (atomic_read(&conn->bytes_to_rcv))
|
if (atomic_read(&conn->bytes_to_rcv))
|
||||||
goto copy;
|
goto copy;
|
||||||
|
|
||||||
|
if (sk->sk_shutdown & RCV_SHUTDOWN ||
|
||||||
|
smc_cdc_rxed_any_close_or_senddone(conn) ||
|
||||||
|
conn->local_tx_ctrl.conn_state_flags.peer_conn_abort)
|
||||||
|
break;
|
||||||
|
|
||||||
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 ||
|
|
||||||
!timeo ||
|
!timeo ||
|
||||||
signal_pending(current) ||
|
signal_pending(current))
|
||||||
smc_cdc_rxed_any_close_or_senddone(conn) ||
|
|
||||||
conn->local_tx_ctrl.conn_state_flags.
|
|
||||||
peer_conn_abort)
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (sk->sk_err) {
|
if (sk->sk_err) {
|
||||||
read_done = sock_error(sk);
|
read_done = sock_error(sk);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (sk->sk_shutdown & RCV_SHUTDOWN ||
|
|
||||||
smc_cdc_rxed_any_close_or_senddone(conn) ||
|
|
||||||
conn->local_tx_ctrl.conn_state_flags.
|
|
||||||
peer_conn_abort)
|
|
||||||
break;
|
|
||||||
if (sk->sk_state == SMC_CLOSED) {
|
if (sk->sk_state == SMC_CLOSED) {
|
||||||
if (!sock_flag(sk, SOCK_DONE)) {
|
if (!sock_flag(sk, SOCK_DONE)) {
|
||||||
/* This occurs when user tries to read
|
/* This occurs when user tries to read
|
||||||
|
|
Loading…
Add table
Reference in a new issue