提交 914e9720 编写于 作者: G Guangguan Wang 提交者: Zheng Zengkai

net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending

stable inclusion
from stable-v5.10.117
commit d5e1b41bf7e02bf2cdccf516adadb083abf4bd0c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L66B

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d5e1b41bf7e02bf2cdccf516adadb083abf4bd0c

--------------------------------

[ Upstream commit f3c46e41 ]

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: 846e344e ("net/smc: add receive timeout check")
Signed-off-by: NGuangguan Wang <guangguan.wang@linux.alibaba.com>
Reviewed-by: NTony Lu <tonylu@linux.alibaba.com>
Acked-by: NKarsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20220512030820.73848-1-guangguan.wang@linux.alibaba.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 07e74af2
...@@ -346,12 +346,12 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, ...@@ -346,12 +346,12 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
} }
break; break;
} }
if (!timeo)
return -EAGAIN;
if (signal_pending(current)) { if (signal_pending(current)) {
read_done = sock_intr_errno(timeo); read_done = sock_intr_errno(timeo);
break; break;
} }
if (!timeo)
return -EAGAIN;
} }
if (!smc_rx_data_available(conn)) { if (!smc_rx_data_available(conn)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册