Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/kern Pull up revision 1.19 (requested by junyoung i...



details:   https://anonhg.NetBSD.org/src/rev/15b3ffdbe0e8
branches:  netbsd-1-6
changeset: 530879:15b3ffdbe0e8
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Oct 19 09:59:42 2003 +0000

description:
Pull up revision 1.19 (requested by junyoung in ticket #1524):
avoid integer overflow during computation of nbuf.  from enami

diffstat:

 sys/kern/kern_allocsys.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 29eecb183f2d -r 15b3ffdbe0e8 sys/kern/kern_allocsys.c
--- a/sys/kern/kern_allocsys.c  Sun Oct 19 09:53:53 2003 +0000
+++ b/sys/kern/kern_allocsys.c  Sun Oct 19 09:59:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_allocsys.c,v 1.18 2001/11/12 15:25:05 lukem Exp $ */
+/*     $NetBSD: kern_allocsys.c,v 1.18.10.1 2003/10/19 09:59:42 tron Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_allocsys.c,v 1.18 2001/11/12 15:25:05 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_allocsys.c,v 1.18.10.1 2003/10/19 09:59:42 tron Exp $");
 
 #include "opt_bufcache.h"
 #include "opt_callout.h"
@@ -171,7 +171,6 @@
                                panic("bufcache is out of range (%d)\n",
                                    bufcache);
                        bufpages = physmem / 100 * bufcache;
-
                } else {
                        if (physmem < btoc(2 * 1024 * 1024))
                                bufpages = physmem / 10;
@@ -206,7 +205,7 @@
         * XXX stopgap measure to prevent wasting too much KVM on
         * the sparsely filled buffer cache.
         */
-       if (nbuf * MAXBSIZE > VM_MAX_KERNEL_BUF)
+       if (nbuf > VM_MAX_KERNEL_BUF / MAXBSIZE)
                nbuf = VM_MAX_KERNEL_BUF / MAXBSIZE;
 #endif
 



Home | Main Index | Thread Index | Old Index