Skip to content

Commit f875a79

Browse files
NeilBrownJ. Bruce Fields
authored andcommitted
nfsd: allow nfsv3 readdir request to be larger.
nfsd currently reports the NFSv3 dtpref FSINFO parameter to be PAGE_SIZE, so NFS clients will typically ask for one page of directory entries at a time. This is needlessly restrictive as nfsd can handle larger replies easily. Also, a READDIR request (but not a READDIRPLUS request) has the count size clipped to PAGE_SIE, again unnecessary. This patch lifts these limits so that larger readdir requests can be used. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent dd83882 commit f875a79

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fs/nfsd/nfs3proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ nfsd3_proc_fsinfo(struct svc_rqst *rqstp)
588588
resp->f_wtmax = max_blocksize;
589589
resp->f_wtpref = max_blocksize;
590590
resp->f_wtmult = PAGE_SIZE;
591-
resp->f_dtpref = PAGE_SIZE;
591+
resp->f_dtpref = max_blocksize;
592592
resp->f_maxfilesize = ~(u32) 0;
593593
resp->f_properties = NFS3_FSF_DEFAULT;
594594

fs/nfsd/nfs3xdr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,14 +573,16 @@ int
573573
nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p)
574574
{
575575
struct nfsd3_readdirargs *args = rqstp->rq_argp;
576+
u32 max_blocksize = svc_max_payload(rqstp);
577+
576578
p = decode_fh(p, &args->fh);
577579
if (!p)
578580
return 0;
579581
p = xdr_decode_hyper(p, &args->cookie);
580582
args->verf = p; p += 2;
581583
args->dircount = ~0;
582584
args->count = ntohl(*p++);
583-
args->count = min_t(u32, args->count, PAGE_SIZE);
585+
args->count = min_t(u32, args->count, max_blocksize);
584586
args->buffer = page_address(*(rqstp->rq_next_page++));
585587

586588
return xdr_argsize_check(rqstp, p);

0 commit comments

Comments
 (0)