mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
NFSv4.2: Handle hole lengths that exceed the READ_PLUS read buffer
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>
This commit is contained in:
parent
82f98c8b11
commit
dac3b1059b
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue