Source-Changes-HG archive

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

[src/trunk]: src/sys/kern sanity check bufcache before using it



details:   https://anonhg.NetBSD.org/src/rev/90d249b2a10a
branches:  trunk
changeset: 473387:90d249b2a10a
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jun 01 00:40:48 1999 +0000

description:
sanity check bufcache before using it

diffstat:

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

diffs (25 lines):

diff -r 2d424263da85 -r 90d249b2a10a sys/kern/kern_allocsys.c
--- a/sys/kern/kern_allocsys.c  Mon May 31 23:57:50 1999 +0000
+++ b/sys/kern/kern_allocsys.c  Tue Jun 01 00:40:48 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_allocsys.c,v 1.3 1999/05/21 00:05:12 thorpej Exp $        */
+/*     $NetBSD: kern_allocsys.c,v 1.4 1999/06/01 00:40:48 lukem Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -161,9 +161,13 @@
         *        the remaining.
         */
        if (bufpages == 0) {
-               if (bufcache != 0)
+               if (bufcache != 0) {
+                       if (bufcache < 5 || bufcache > 95)
+                               panic("bufcache is out of range (%d)\n",
+                                   bufcache);
                        bufpages = physmem / CLSIZE * bufcache / 100;
-               else {
+
+               } else {
                        if (physmem < btoc(2 * 1024 * 1024))
                                bufpages = physmem / (10 * CLSIZE);
                        else



Home | Main Index | Thread Index | Old Index