summaryrefslogtreecommitdiff
path: root/fs/ksmbd/transport_tcp.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-01-18 16:52:20 -0800
committerAndrew Morton <akpm@linux-foundation.org>2023-01-18 16:52:20 -0800
commitbd86d2ea369be2e768b58cba590e70b8bdc6f86a (patch)
tree4cd68e21041237c0a4d7e0299f9bb3eeb1ac1e2c /fs/ksmbd/transport_tcp.c
parent19fa92fb72f8bc542f1673862058f3b078114004 (diff)
parent5dc4c995db9eb45f6373a956eb1f69460e69e6d4 (diff)
downloadlinux-rpi-bd86d2ea369be2e768b58cba590e70b8bdc6f86a.tar.gz
linux-rpi-bd86d2ea369be2e768b58cba590e70b8bdc6f86a.tar.bz2
linux-rpi-bd86d2ea369be2e768b58cba590e70b8bdc6f86a.zip
Sync with v6.2-rc4
Merge branch 'master' into mm-hotfixes-stable
Diffstat (limited to 'fs/ksmbd/transport_tcp.c')
-rw-r--r--fs/ksmbd/transport_tcp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ksmbd/transport_tcp.c b/fs/ksmbd/transport_tcp.c
index 63d55f543bd2..4c6bd0b69979 100644
--- a/fs/ksmbd/transport_tcp.c
+++ b/fs/ksmbd/transport_tcp.c
@@ -295,6 +295,7 @@ static int ksmbd_tcp_readv(struct tcp_transport *t, struct kvec *iov_orig,
struct msghdr ksmbd_msg;
struct kvec *iov;
struct ksmbd_conn *conn = KSMBD_TRANS(t)->conn;
+ int max_retry = 2;
iov = get_conn_iovec(t, nr_segs);
if (!iov)
@@ -321,9 +322,11 @@ static int ksmbd_tcp_readv(struct tcp_transport *t, struct kvec *iov_orig,
} else if (conn->status == KSMBD_SESS_NEED_RECONNECT) {
total_read = -EAGAIN;
break;
- } else if (length == -ERESTARTSYS || length == -EAGAIN) {
+ } else if ((length == -ERESTARTSYS || length == -EAGAIN) &&
+ max_retry) {
usleep_range(1000, 2000);
length = 0;
+ max_retry--;
continue;
} else if (length <= 0) {
total_read = -EAGAIN;