提交 a60214c2 编写于 作者: A Anna Schumaker 提交者: Trond Myklebust

NFS: Allow very small rsize & wsize again

940261a1 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: NJeff Layton <jlayton@kernel.org>
Fixes: 940261a1 ("NFS: Allow setting rsize / wsize to a multiple of PAGE_SIZE")
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: NJeff Layton <jlayton@kernel.org>
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
上级 f8527028
...@@ -739,12 +739,10 @@ unsigned long nfs_io_size(unsigned long iosize, enum xprt_transports proto) ...@@ -739,12 +739,10 @@ unsigned long nfs_io_size(unsigned long iosize, enum xprt_transports proto)
iosize = NFS_DEF_FILE_IO_SIZE; iosize = NFS_DEF_FILE_IO_SIZE;
else if (iosize >= NFS_MAX_FILE_IO_SIZE) else if (iosize >= NFS_MAX_FILE_IO_SIZE)
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 nfs_block_bits(iosize, NULL);
return iosize; return iosize & PAGE_MASK;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册