diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index 6e67c5be341..1054c85d8e8 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -89,8 +89,11 @@ * It used to be called NFS_MAXDATA, but has been renamed to clarify that * it refers to server side only and doesn't conflict with the NFS_MAXDATA * defined in rpcsvc/nfs_prot.h for userland. + * NFS_SRVMAXIO is the default setting for vfs.nfsd.srvmaxio + * NFS_SRVLIMITIO is the maximum setting allowed for vfs.nfsd.srvmaxio */ #define NFS_SRVMAXIO (128 * 1024) +#define NFS_SRVLIMITIO (4 * 1024 * 1024) /* Stat numbers for rpc returns (version 2, 3 and 4) */ /* diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index e42d5ca1e0a..1e6936ed351 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -241,8 +241,9 @@ sysctl_srvmaxio(SYSCTL_HANDLER_ARGS) printf("nfsd: vfs.nfsd.srvmaxio can only be increased\n"); return (EINVAL); } - if (newsrvmaxio > 1048576) { - printf("nfsd: vfs.nfsd.srvmaxio cannot be > 1Mbyte\n"); + if (newsrvmaxio > NFS_SRVLIMITIO) { + printf("nfsd: vfs.nfsd.srvmaxio cannot be > %d\n", + NFS_SRVLIMITIO); return (EINVAL); } if ((newsrvmaxio & (newsrvmaxio - 1)) != 0) {