Skip to content

Commit a60214c

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
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 <[email protected]> Fixes: 940261a ("NFS: Allow setting rsize / wsize to a multiple of PAGE_SIZE") Signed-off-by: Anna Schumaker <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent f852702 commit a60214c

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)