Commit d5d5c304 authored by Kinglong Mee's avatar Kinglong Mee Committed by J. Bruce Fields

NFSD: Fix bad checking of space for padding in splice read

Note that the caller has already reserved space for count and eof, so
xdr->p has already moved past them, only the padding remains.
Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Fixes dc97618d (nfsd4: separate splice and readv cases)
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 35e634b8
...@@ -3072,11 +3072,8 @@ static __be32 nfsd4_encode_splice_read( ...@@ -3072,11 +3072,8 @@ static __be32 nfsd4_encode_splice_read(
__be32 nfserr; __be32 nfserr;
__be32 *p = xdr->p - 2; __be32 *p = xdr->p - 2;
/* /* Make sure there will be room for padding if needed */
* Don't inline pages unless we know there's room for eof, if (xdr->end - xdr->p < 1)
* count, and possible padding:
*/
if (xdr->end - xdr->p < 3)
return nfserr_resource; return nfserr_resource;
nfserr = nfsd_splice_read(read->rd_rqstp, file, nfserr = nfsd_splice_read(read->rd_rqstp, file,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment