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>
This commit is contained in:
Kinglong Mee 2014-07-09 21:51:27 +08:00 коммит произвёл J. Bruce Fields
Родитель 35e634b83c
Коммит d5d5c304b1
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -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,