From: Geliang Tang <tanggeliang@kylinos.cn>
Update the parameter of mptcp_recv_should_stop.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/protocol.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 73359a61ec80..a3eb39a45403 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -4060,7 +4060,6 @@ static ssize_t mptcp_splice_read(struct socket *sock, loff_t *ppos,
.flags = flags,
};
struct sock *sk = sock->sk;
- int shutdown = -1;
ssize_t spliced;
long timeo;
int ret;
@@ -4086,11 +4085,15 @@ static ssize_t mptcp_splice_read(struct socket *sock, loff_t *ppos,
break;
if (sock_flag(sk, SOCK_DONE))
break;
- ret = mptcp_recv_should_stop(sk, timeo, &shutdown);
- if (ret < 0 || shutdown == 1)
+ ret = mptcp_recv_should_stop(sk, timeo);
+ if (ret == -ESHUTDOWN) {
+ ret = 0;
+ if (__mptcp_move_skbs(sk))
+ continue;
break;
- if (shutdown == 0)
- continue;
+ } else if (ret < 0) {
+ break;
+ }
/* if __mptcp_splice_read() got nothing while we have
* an skb in receive queue, we do not want to loop.
* This might happen with URG data.
--
2.48.1