diff options
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 59c319528cf9..d95d9015e50a 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1500,13 +1500,14 @@ static inline u32 nfsd4_read_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) | |||
1500 | 1500 | ||
1501 | static inline u32 nfsd4_readdir_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) | 1501 | static inline u32 nfsd4_readdir_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) |
1502 | { | 1502 | { |
1503 | u32 maxcount = svc_max_payload(rqstp); | ||
1503 | u32 rlen = op->u.readdir.rd_maxcount; | 1504 | u32 rlen = op->u.readdir.rd_maxcount; |
1504 | 1505 | ||
1505 | if (rlen > PAGE_SIZE) | 1506 | if (rlen > maxcount) |
1506 | rlen = PAGE_SIZE; | 1507 | rlen = maxcount; |
1507 | 1508 | ||
1508 | return (op_encode_hdr_size + op_encode_verifier_maxsz) | 1509 | return (op_encode_hdr_size + op_encode_verifier_maxsz + |
1509 | * sizeof(__be32) + rlen; | 1510 | XDR_QUADLEN(rlen)) * sizeof(__be32); |
1510 | } | 1511 | } |
1511 | 1512 | ||
1512 | static inline u32 nfsd4_remove_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) | 1513 | static inline u32 nfsd4_remove_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) |