]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFSD: Add a "default" block size
authorChuck Lever <chuck.lever@oracle.com>
Mon, 28 Apr 2025 19:37:01 +0000 (15:37 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 15 May 2025 20:16:28 +0000 (16:16 -0400)
We'd like to increase the maximum r/wsize that NFSD can support,
but without introducing possible regressions. So let's add a
default setting of 1MB. A subsequent patch will raise the
maximum value but leave the default alone.

No behavior change is expected.

Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsd.h
fs/nfsd/nfssvc.c

index 6428a431d7659dd47ae4656d26df8c4bdc11224f..1bfd0b4e9af7b84d98c27abc04741d7eae126cfa 100644 (file)
@@ -44,9 +44,14 @@ bool nfsd_support_version(int vers);
 #include "stats.h"
 
 /*
- * Maximum blocksizes supported by daemon under various circumstances.
+ * Default and maximum payload size (NFS READ or WRITE), in bytes.
+ * The default is historical, and the maximum is an implementation
+ * limit.
  */
-#define NFSSVC_MAXBLKSIZE       RPCSVC_MAXPAYLOAD
+enum {
+       NFSSVC_DEFBLKSIZE       = 1 * 1024 * 1024,
+       NFSSVC_MAXBLKSIZE       = RPCSVC_MAXPAYLOAD,
+};
 
 struct readdir_cd {
        __be32                  err;    /* 0, nfserr, or nfserr_eof */
index 8ed143ef8b41153554f9b8dc6666eb4c60b06577..82b0111ac469c4cccbe9838e1637c461222150b2 100644 (file)
@@ -582,7 +582,7 @@ static int nfsd_get_default_max_blksize(void)
         */
        target >>= 12;
 
-       ret = NFSSVC_MAXBLKSIZE;
+       ret = NFSSVC_DEFBLKSIZE;
        while (ret > target && ret >= 8*1024*2)
                ret /= 2;
        return ret;