From: Jeff Layton <jlayton@kernel.org>
To: Anna Schumaker <anna@kernel.org>,
linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com
Cc: tom@talpey.com
Subject: Re: [PATCH] NFS: Allow very small rsize & wsize again
Date: Thu, 01 Dec 2022 06:44:26 -0500 [thread overview]
Message-ID: <23eddc9b078dd50f48d6bc7b0084f456dd4f1f9d.camel@kernel.org> (raw)
In-Reply-To: <20221130203047.1303804-1-anna@kernel.org>
On Wed, 2022-11-30 at 15:30 -0500, Anna Schumaker wrote:
> From: Anna Schumaker <Anna.Schumaker@Netapp.com>
>
> 940261a19508 introduced nfs_io_size() to clamp the iosize to a multiple
> of PAGE_SIZE. This had the unintended side effect of no longer allowing
> iosizes less than a page, which could be useful in some situations.
>
> UDP already has an exception that causes it to fall back on the
> power-of-two style sizes instead. This patch adds an additional
> exception for very small iosizes.
>
> Reported-by: Jeff Layton <jlayton@kernel.org>
> Fixes: 940261a19508 ("NFS: Allow setting rsize / wsize to a multiple of PAGE_SIZE")
> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> ---
> fs/nfs/internal.h | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> index 647fc3f547cb..ae7d4a8c728c 100644
> --- a/fs/nfs/internal.h
> +++ b/fs/nfs/internal.h
> @@ -739,12 +739,10 @@ unsigned long nfs_io_size(unsigned long iosize, enum xprt_transports proto)
> iosize = NFS_DEF_FILE_IO_SIZE;
> else if (iosize >= NFS_MAX_FILE_IO_SIZE)
> iosize = NFS_MAX_FILE_IO_SIZE;
> - else
> - iosize = iosize & PAGE_MASK;
>
> - if (proto == XPRT_TRANSPORT_UDP)
> + if (proto == XPRT_TRANSPORT_UDP || iosize < PAGE_SIZE)
> return nfs_block_bits(iosize, NULL);
> - return iosize;
> + return iosize & PAGE_MASK;
> }
>
> /*
Looks good. Thanks, Anna.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2022-12-01 11:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 20:30 [PATCH] NFS: Allow very small rsize & wsize again Anna Schumaker
2022-12-01 11:44 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23eddc9b078dd50f48d6bc7b0084f456dd4f1f9d.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=anna@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=tom@talpey.com \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox