Module Name: src
Committed By: martin
Date: Fri Sep 20 10:29:41 UTC 2024
Modified Files:
src/sys/nfs [netbsd-10]: nfs_vfsops.c
Log Message:
Pull up following revision(s) (requested by rin in ticket #879):
sys/nfs/nfs_vfsops.c: revision 1.244
Avoid overflow of nfs_commitsize on machines with > 32GB RAM.
To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.243.10.1 src/sys/nfs/nfs_vfsops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/nfs/nfs_vfsops.c
diff -u src/sys/nfs/nfs_vfsops.c:1.243 src/sys/nfs/nfs_vfsops.c:1.243.10.1
--- src/sys/nfs/nfs_vfsops.c:1.243 Sun Jun 13 10:25:11 2021
+++ src/sys/nfs/nfs_vfsops.c Fri Sep 20 10:29:41 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_vfsops.c,v 1.243 2021/06/13 10:25:11 mlelstv Exp $ */
+/* $NetBSD: nfs_vfsops.c,v 1.243.10.1 2024/09/20 10:29:41 martin Exp $ */
/*
* Copyright (c) 1989, 1993, 1995
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.243 2021/06/13 10:25:11 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.243.10.1 2024/09/20 10:29:41 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfs.h"
@@ -1135,6 +1135,7 @@ nfs_start(struct mount *mp, int flags)
void
nfs_vfs_init(void)
{
+ unsigned scale;
/* Initialize NFS server / client shared data. */
nfs_init();
@@ -1145,7 +1146,8 @@ nfs_vfs_init(void)
/* Initialize the iod structures */
nfs_iodinit();
- nfs_commitsize = uvmexp.npages << (PAGE_SHIFT - 4);
+ scale = PAGE_SHIFT - 4;
+ nfs_commitsize = uimin(uvmexp.npages, INT_MAX >> scale) << scale;
}
void