Skip to content

Commit

Permalink
net/smc: non blocking recvmsg() return -EAGAIN when no data and signa…
Browse files Browse the repository at this point in the history
…l_pending

Non blocking sendmsg will return -EAGAIN when any signal pending
and no send space left, while non blocking recvmsg return -EINTR
when signal pending and no data received. This may makes confused.
As TCP returns -EAGAIN in the conditions described above. Align the
behavior of smc with TCP.

Fixes: 846e344 ("net/smc: add receive timeout check")
Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20220512030820.73848-1-guangguan.wang@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Guangguan Wang authored and Jakub Kicinski committed May 12, 2022
1 parent b7be130 commit f3c46e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/smc/smc_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
}
break;
}
if (!timeo)
return -EAGAIN;
if (signal_pending(current)) {
read_done = sock_intr_errno(timeo);
break;
}
if (!timeo)
return -EAGAIN;
}

if (!smc_rx_data_available(conn)) {
Expand Down

0 comments on commit f3c46e4

Please sign in to comment.