projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
82f98c8
)
NFSv4.2: Handle hole lengths that exceed the READ_PLUS read buffer
author
Trond Myklebust
<trond.myklebust@hammerspace.com>
Tue, 8 Dec 2020 13:41:01 +0000
(08:41 -0500)
committer
Trond Myklebust
<trond.myklebust@hammerspace.com>
Mon, 14 Dec 2020 11:51:08 +0000
(06:51 -0500)
If a hole extends beyond the READ_PLUS read buffer, then we want to fill
just the remaining buffer with zeros. Also ignore eof...
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs42xdr.c
patch
|
blob
|
history
diff --git
a/fs/nfs/nfs42xdr.c
b/fs/nfs/nfs42xdr.c
index f9faa131a4f5049361eb203b31883776fbbe6f07..6ba2a28e7e03f4326196e9b24bf87bb2e61d16d8 100644
(file)
--- a/
fs/nfs/nfs42xdr.c
+++ b/
fs/nfs/nfs42xdr.c
@@
-1080,6
+1080,12
@@
static int decode_read_plus_hole(struct xdr_stream *xdr,
}
length -= args->offset + res->count - offset;
}
+ if (length + res->count > args->count) {
+ *eof = 0;
+ if (unlikely(res->count >= args->count))
+ return 1;
+ length = args->count - res->count;
+ }
recvd = xdr_expand_hole(xdr, res->count, length);
res->count += recvd;