NFS: Allow very small rsize & wsize again
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 30 Nov 2022 20:30:47 +0000 (15:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:23 +0000 (13:32 +0100)
commita89715bc95233a31441c0474daabba1d5d36c016
treef35cd692344ce8dce8effc747d01a9fe3279741a
parentf6a174755c330fe30ba023c4511ce1caf51a7ce1
NFS: Allow very small rsize & wsize again

[ Upstream commit a60214c2465493aac0b014d87ee19327b6204c42 ]

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>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/internal.h