Skip to content

Commit d5d5c30

Browse files
kinglongmeeJ. Bruce Fields
authored andcommitted
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 <[email protected]> Fixes dc97618 (nfsd4: separate splice and readv cases) Signed-off-by: J. Bruce Fields <[email protected]>
1 parent 35e634b commit d5d5c30

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,11 +3072,8 @@ static __be32 nfsd4_encode_splice_read(
30723072
__be32 nfserr;
30733073
__be32 *p = xdr->p - 2;
30743074

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

30823079
nfserr = nfsd_splice_read(read->rd_rqstp, file,

0 commit comments

Comments
 (0)