Skip to content

Commit f3c46e4

Browse files
GuangguanWangkuba-moo
authored andcommitted
net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_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 <[email protected]> Reviewed-by: Tony Lu <[email protected]> Acked-by: Karsten Graul <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b7be130 commit f3c46e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/smc/smc_rx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,12 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
355355
}
356356
break;
357357
}
358+
if (!timeo)
359+
return -EAGAIN;
358360
if (signal_pending(current)) {
359361
read_done = sock_intr_errno(timeo);
360362
break;
361363
}
362-
if (!timeo)
363-
return -EAGAIN;
364364
}
365365

366366
if (!smc_rx_data_available(conn)) {

0 commit comments

Comments
 (0)