aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r--fs/nfsd/nfsctl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 51844048937f..6a6f65cc8b34 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -369,8 +369,7 @@ static ssize_t write_filehandle(struct file *file, char *buf, size_t size)
369 369
370 if (maxsize < NFS_FHSIZE) 370 if (maxsize < NFS_FHSIZE)
371 return -EINVAL; 371 return -EINVAL;
372 if (maxsize > NFS3_FHSIZE) 372 maxsize = min(maxsize, NFS3_FHSIZE);
373 maxsize = NFS3_FHSIZE;
374 373
375 if (qword_get(&mesg, mesg, size)>0) 374 if (qword_get(&mesg, mesg, size)>0)
376 return -EINVAL; 375 return -EINVAL;
@@ -871,10 +870,8 @@ static ssize_t write_maxblksize(struct file *file, char *buf, size_t size)
871 /* force bsize into allowed range and 870 /* force bsize into allowed range and
872 * required alignment. 871 * required alignment.
873 */ 872 */
874 if (bsize < 1024) 873 bsize = max_t(int, bsize, 1024);
875 bsize = 1024; 874 bsize = min_t(int, bsize, NFSSVC_MAXBLKSIZE);
876 if (bsize > NFSSVC_MAXBLKSIZE)
877 bsize = NFSSVC_MAXBLKSIZE;
878 bsize &= ~(1024-1); 875 bsize &= ~(1024-1);
879 mutex_lock(&nfsd_mutex); 876 mutex_lock(&nfsd_mutex);
880 if (nn->nfsd_serv) { 877 if (nn->nfsd_serv) {