* [PATCH net v2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending
@ 2022-05-12 3:08 Guangguan Wang
2022-05-12 12:01 ` Karsten Graul
2022-05-12 18:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Guangguan Wang @ 2022-05-12 3:08 UTC (permalink / raw)
To: kgraul, davem, kuba, tonylu; +Cc: linux-s390, netdev, linux-kernel
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: 846e344eb722 ("net/smc: add receive timeout check")
Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
---
net/smc/smc_rx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
index 51e8eb2933ff..338b9ef806e8 100644
--- a/net/smc/smc_rx.c
+++ b/net/smc/smc_rx.c
@@ -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)) {
--
2.24.3 (Apple Git-128)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending
2022-05-12 3:08 [PATCH net v2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending Guangguan Wang
@ 2022-05-12 12:01 ` Karsten Graul
2022-05-12 18:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Karsten Graul @ 2022-05-12 12:01 UTC (permalink / raw)
To: Guangguan Wang, davem, kuba, tonylu; +Cc: linux-s390, netdev, linux-kernel
On 12/05/2022 05:08, Guangguan Wang wrote:
> 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: 846e344eb722 ("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>
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending
2022-05-12 3:08 [PATCH net v2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending Guangguan Wang
2022-05-12 12:01 ` Karsten Graul
@ 2022-05-12 18:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-12 18:40 UTC (permalink / raw)
To: Guangguan Wang
Cc: kgraul, davem, kuba, tonylu, linux-s390, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 12 May 2022 11:08:20 +0800 you wrote:
> 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: 846e344eb722 ("net/smc: add receive timeout check")
> Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
> Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
>
> [...]
Here is the summary with links:
- [net,v2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending
https://git.kernel.org/netdev/net/c/f3c46e41b32b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-12 18:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-12 3:08 [PATCH net v2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending Guangguan Wang
2022-05-12 12:01 ` Karsten Graul
2022-05-12 18:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox