Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6196916imb; Fri, 8 Mar 2019 11:30:26 -0800 (PST) X-Google-Smtp-Source: APXvYqz2FWh4IJVfOUnpBv3ZNSEN1wVsK0vaPG+qWJuo+SetfWlCKPCHrgnDYOyAHkD6Ta3nhSfL X-Received: by 2002:a17:902:1c9:: with SMTP id b67mr19960885plb.176.1552073426603; Fri, 08 Mar 2019 11:30:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552073426; cv=none; d=google.com; s=arc-20160816; b=cKALToPANeoWhUay7wWWT/wMMiKJWh1gF8rXJ0IQcAldVgMewvINRj1EtjmKXqWFeA Ub/F5Q9PWzS4jxwxLkxgKjBEBl25vNO8r0GvjmhpWZ6/H5C04MKKq1ODVxCBexMzJaOY WFqjTOwFeTzWEFQhlRADRd1F8v4jkPM57f+hnFJFDUFlzin7lm0IFVErQH8UhfvY7orr EXUNLnOegq4cBp3omgYzO+CEi62pIXcgzrAk2QIyW/5H92Pa/C06NKHd9Cju5qVzMj51 in0sHRzR+57GOXPGpGFFdWRQK9QDmeT6cZf0Usa1GXWm8JRzILXAa3AxNzLcytO2y8YE lfSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jYqIbOCrugP8HNVE49WwCx5chudj6CwatvwzSjxUKO8=; b=h5NL9N+VeR4CYeLWzHFX3wLvXHB9P6SfPutcEAQqWGpTJcVjXOgq1kd1mlkPohcZyz /xRuvxPgh0s34Z/qFoqwleto2+dvxrWfLtobON5fHw6Ana5LBosHnLjMuRKAD+iXB9XH QOl2RwDOCpgga0/SXLHZ7Dayq4jZZoga3bEbmlSjPk23h+xcYEfx31r95g6Kb0f1bVID j2WwevSDQ3ZjY6xUz6YXrydtJKImpY1WosQ1+tb/hqRjrlUWZiIeyp9ex8LgMMznNydQ BCG/ZYcbNth7Qal3MXhLOwisfgW2LgVxE9W7/sCs1q5UGyYdXcFv+YX6SQaeNptQYzOk hZwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si7552326pls.374.2019.03.08.11.30.10; Fri, 08 Mar 2019 11:30:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbfCHT3r (ORCPT + 99 others); Fri, 8 Mar 2019 14:29:47 -0500 Received: from fieldses.org ([173.255.197.46]:45044 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbfCHT3r (ORCPT ); Fri, 8 Mar 2019 14:29:47 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 0ACCD1C82; Fri, 8 Mar 2019 14:29:47 -0500 (EST) Date: Fri, 8 Mar 2019 14:29:47 -0500 From: "J. Bruce Fields" To: NeilBrown Cc: Jeff Layton , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nfsd: allow nfsv3 readdir request to be larger. Message-ID: <20190308192947.GA27011@fieldses.org> References: <87lg1vs5eh.fsf@notabene.neil.brown.name> <20190304164725.GE13690@fieldses.org> <877ederyjm.fsf@notabene.neil.brown.name> <20190305214212.GC27437@fieldses.org> <87y35rr52t.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y35rr52t.fsf@notabene.neil.brown.name> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks! Applied. On Thu, Mar 07, 2019 at 09:49:46AM +1100, NeilBrown wrote: > > nfsd currently reports the NFSv4 dtpref FSINFO parameter (Just changed NFSv4 here to NFSv3.)--b. > 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 > --- > fs/nfsd/nfs3proc.c | 2 +- > fs/nfsd/nfs3xdr.c | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c > index c9cf46e0c040..8f933e84cec1 100644 > --- a/fs/nfsd/nfs3proc.c > +++ b/fs/nfsd/nfs3proc.c > @@ -588,7 +588,7 @@ nfsd3_proc_fsinfo(struct svc_rqst *rqstp) > resp->f_wtmax = max_blocksize; > resp->f_wtpref = max_blocksize; > resp->f_wtmult = PAGE_SIZE; > - resp->f_dtpref = PAGE_SIZE; > + resp->f_dtpref = max_blocksize; > resp->f_maxfilesize = ~(u32) 0; > resp->f_properties = NFS3_FSF_DEFAULT; > > diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c > index 83919116d5cb..93fea246f676 100644 > --- a/fs/nfsd/nfs3xdr.c > +++ b/fs/nfsd/nfs3xdr.c > @@ -573,6 +573,8 @@ int > nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) > { > struct nfsd3_readdirargs *args = rqstp->rq_argp; > + u32 max_blocksize = svc_max_payload(rqstp); > + > p = decode_fh(p, &args->fh); > if (!p) > return 0; > @@ -580,7 +582,7 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) > args->verf = p; p += 2; > args->dircount = ~0; > args->count = ntohl(*p++); > - args->count = min_t(u32, args->count, PAGE_SIZE); > + args->count = min_t(u32, args->count, max_blocksize); > args->buffer = page_address(*(rqstp->rq_next_page++)); > > return xdr_argsize_check(rqstp, p); > -- > 2.14.0.rc0.dirty >