|
@@ -3651,7 +3651,8 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4
|
|
nfserr = nfserr_resource;
|
|
nfserr = nfserr_resource;
|
|
goto err_no_verf;
|
|
goto err_no_verf;
|
|
}
|
|
}
|
|
- maxcount = min_t(u32, readdir->rd_maxcount, INT_MAX);
|
|
|
|
|
|
+ maxcount = svc_max_payload(resp->rqstp);
|
|
|
|
+ maxcount = min_t(u32, readdir->rd_maxcount, maxcount);
|
|
/*
|
|
/*
|
|
* Note the rfc defines rd_maxcount as the size of the
|
|
* Note the rfc defines rd_maxcount as the size of the
|
|
* READDIR4resok structure, which includes the verifier above
|
|
* READDIR4resok structure, which includes the verifier above
|
|
@@ -3665,7 +3666,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4
|
|
|
|
|
|
/* RFC 3530 14.2.24 allows us to ignore dircount when it's 0: */
|
|
/* RFC 3530 14.2.24 allows us to ignore dircount when it's 0: */
|
|
if (!readdir->rd_dircount)
|
|
if (!readdir->rd_dircount)
|
|
- readdir->rd_dircount = INT_MAX;
|
|
|
|
|
|
+ readdir->rd_dircount = svc_max_payload(resp->rqstp);
|
|
|
|
|
|
readdir->xdr = xdr;
|
|
readdir->xdr = xdr;
|
|
readdir->rd_maxcount = maxcount;
|
|
readdir->rd_maxcount = maxcount;
|