summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust2019-03-15 17:47:34 +0100
committerTrond Myklebust2019-03-15 18:06:21 +0100
commit9734ad57b0f1a367fd3a00d717f97f8c00d9edb7 (patch)
tree2990623cbed5edec300f54d2e46184f7c95be2ca /net/sunrpc/xprtsock.c
parentpNFS: Fix a typo in pnfs_update_layout (diff)
downloadkernel-qcow2-linux-9734ad57b0f1a367fd3a00d717f97f8c00d9edb7.tar.gz
kernel-qcow2-linux-9734ad57b0f1a367fd3a00d717f97f8c00d9edb7.tar.xz
kernel-qcow2-linux-9734ad57b0f1a367fd3a00d717f97f8c00d9edb7.zip
SUNRPC: Fix a client regression when handling oversized replies
If the server sends a reply that is larger than the pre-allocated buffer, then the current code may fail to register how much of the stream that it has finished reading. This again can lead to hangs. Fixes: e92053a52e68 ("SUNRPC: Handle zero length fragments correctly") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 42f45d33dc56..9359539907ba 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -453,7 +453,7 @@ xs_read_xdr_buf(struct socket *sock, struct msghdr *msg, int flags,
goto out;
if (ret != want)
goto out;
- } else
+ } else if (offset < seek_init)
offset = seek_init;
ret = -EMSGSIZE;
out: