From: Guangguan Wang <guangguan.wang@linux.alibaba.com>
To: kgraul@linux.ibm.com, davem@davemloft.net, kuba@kernel.org
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net 1/2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending
Date: Mon, 9 May 2022 19:58:36 +0800 [thread overview]
Message-ID: <20220509115837.94911-2-guangguan.wang@linux.alibaba.com> (raw)
In-Reply-To: <20220509115837.94911-1-guangguan.wang@linux.alibaba.com>
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 descriped above. Align the
behavior of smc with TCP.
Signed-off-by: Guangguan Wang <guangguan.wang@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)
next prev parent reply other threads:[~2022-05-09 11:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 11:58 [PATCH net 0/2] net/smc: two fixes for using smc with io_uring Guangguan Wang
2022-05-09 11:58 ` Guangguan Wang [this message]
2022-05-10 3:23 ` [PATCH net 1/2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending Tony Lu
2022-05-09 11:58 ` [PATCH net 2/2] net/smc: align the connect behaviour with TCP Guangguan Wang
2022-05-10 9:30 ` Tony Lu
2022-05-10 12:58 ` Guangguan Wang
2022-05-11 13:32 ` Tony Lu
2022-05-10 11:05 ` Paolo Abeni
2022-05-10 13:03 ` Guangguan Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220509115837.94911-2-guangguan.wang@linux.alibaba.com \
--to=guangguan.wang@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®