Skip to content

Commit 8cfc686

Browse files
committed
NFS: Allow very small rsize & wsize again
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2107347 commit a60214c Author: Anna Schumaker <Anna.Schumaker@Netapp.com> Date: Wed Nov 30 15:30:47 2022 -0500 NFS: Allow very small rsize & wsize again 940261a 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: 940261a ("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: Benjamin Coddington <bcodding@redhat.com>
1 parent 1ac84d4 commit 8cfc686

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/nfs/internal.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,12 +739,10 @@ unsigned long nfs_io_size(unsigned long iosize, enum xprt_transports proto)
739739
iosize = NFS_DEF_FILE_IO_SIZE;
740740
else if (iosize >= NFS_MAX_FILE_IO_SIZE)
741741
iosize = NFS_MAX_FILE_IO_SIZE;
742-
else
743-
iosize = iosize & PAGE_MASK;
744742

745-
if (proto == XPRT_TRANSPORT_UDP)
743+
if (proto == XPRT_TRANSPORT_UDP || iosize < PAGE_SIZE)
746744
return nfs_block_bits(iosize, NULL);
747-
return iosize;
745+
return iosize & PAGE_MASK;
748746
}
749747

750748
/*

0 commit comments

Comments
 (0)