Skip to content

Commit

Permalink
NFSD: Fix bad checking of space for padding in splice read
Browse files Browse the repository at this point in the history
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: Kinglong Mee <kinglongmee@gmail.com>
Fixes dc97618 (nfsd4: separate splice and readv cases)
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Kinglong Mee authored and J. Bruce Fields committed Jul 11, 2014
1 parent 35e634b commit d5d5c30
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3072,11 +3072,8 @@ static __be32 nfsd4_encode_splice_read(
__be32 nfserr;
__be32 *p = xdr->p - 2;

/*
* Don't inline pages unless we know there's room for eof,
* count, and possible padding:
*/
if (xdr->end - xdr->p < 3)
/* Make sure there will be room for padding if needed */
if (xdr->end - xdr->p < 1)
return nfserr_resource;

nfserr = nfsd_splice_read(read->rd_rqstp, file,
Expand Down

0 comments on commit d5d5c30

Please sign in to comment.