aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-07-09 09:51:27 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-07-11 15:19:25 -0400
commitd5d5c304b13bc3cade13b8a1b5833c8b3a0975f1 (patch)
tree702bde6d9f9810740dd7fe6e63726aedfbe33ac3 /fs/nfsd/nfs4xdr.c
parent35e634b83cbe23e5673289d1536752968aab8f75 (diff)
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: Kinglong Mee <kinglongmee@gmail.com> Fixes dc97618ddd (nfsd4: separate splice and readv cases) Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 1ad7bd4e346f..01023a595163 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3072,11 +3072,8 @@ static __be32 nfsd4_encode_splice_read(
3072 __be32 nfserr; 3072 __be32 nfserr;
3073 __be32 *p = xdr->p - 2; 3073 __be32 *p = xdr->p - 2;
3074 3074
3075 /* 3075 /* Make sure there will be room for padding if needed */
3076 * Don't inline pages unless we know there's room for eof, 3076 if (xdr->end - xdr->p < 1)
3077 * count, and possible padding:
3078 */
3079 if (xdr->end - xdr->p < 3)
3080 return nfserr_resource; 3077 return nfserr_resource;
3081 3078
3082 nfserr = nfsd_splice_read(read->rd_rqstp, file, 3079 nfserr = nfsd_splice_read(read->rd_rqstp, file,