On 9/9/25 7:33 PM, Mike Snitzer wrote: > nfsd_iter_read() might need two extra pages when a READ payload is not > DIO-aligned -- but nfsd_iter_read() and nfsd_splice_actor() are > mutually exclusive (so reuse page reserved for nfsd_splice_actor). > > Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> > --- > include/linux/sunrpc/svc.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h > index e64ab444e0a7f..190c2667500e2 100644 > --- a/include/linux/sunrpc/svc.h > +++ b/include/linux/sunrpc/svc.h > @@ -163,10 +163,13 @@ extern u32 svc_max_payload(const struct svc_rqst *rqstp); > * pages, one for the request, and one for the reply. > * nfsd_splice_actor() might need an extra page when a READ payload > * is not page-aligned. > + * nfsd_iter_read() might need two extra pages when a READ payload > + * is not DIO-aligned -- but nfsd_iter_read() and nfsd_splice_actor() > + * are mutually exclusive (so reuse page reserved for nfsd_splice_actor). > */ > static inline unsigned long svc_serv_maxpages(const struct svc_serv *serv) > { > - return DIV_ROUND_UP(serv->sv_max_mesg, PAGE_SIZE) + 2 + 1; > + return DIV_ROUND_UP(serv->sv_max_mesg, PAGE_SIZE) + 2 + 1 + 1; > } > > /* I'm not convinced an additional page is necessary. The most the direct I/O range can be is rsize + 1 page, AFAICT, and that seems to be covered already. If we want NFSD to support file systems / block devices with alignment requirements large than a page, then perhaps additional buffer space will be needed... or NFSD can return a short read. -- Chuck Lever