Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Don't allow configuration where the specif...



details:   https://anonhg.NetBSD.org/src/rev/606212e0c83f
branches:  trunk
changeset: 484977:606212e0c83f
user:      oster <oster%NetBSD.org@localhost>
date:      Sun Apr 16 03:24:26 2000 +0000

description:
Don't allow configuration where the specified SectPerSU may result in IO larger
than MAXPHYS being sent to underlying devices.  Addresses PR#9868.
Will change if/when MAXPHYS goes bye-bye.

diffstat:

 sys/dev/raidframe/rf_layout.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (34 lines):

diff -r 2ce66e804fa4 -r 606212e0c83f sys/dev/raidframe/rf_layout.c
--- a/sys/dev/raidframe/rf_layout.c     Sun Apr 16 03:17:59 2000 +0000
+++ b/sys/dev/raidframe/rf_layout.c     Sun Apr 16 03:24:26 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_layout.c,v 1.4 1999/07/19 01:35:19 oster Exp $      */
+/*     $NetBSD: rf_layout.c,v 1.5 2000/04/16 03:24:26 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -29,6 +29,9 @@
 /* rf_layout.c -- driver code dealing with layout and mapping issues
  */
 
+#include <sys/types.h>
+#include <machine/param.h>
+
 #include "rf_types.h"
 #include "rf_archs.h"
 #include "rf_raid.h"
@@ -443,6 +446,14 @@
                return (EINVAL); 
        }
 
+       if ((layoutPtr->sectorsPerStripeUnit * 
+            (1 << raidPtr->logBytesPerSector)) > MAXPHYS) {
+               RF_ERRORMSG2("raid%d: sectorsPerStripeUnit (%d) would exceed MAXPHYS\n",
+                            raidPtr->raidid, 
+                            (int)layoutPtr->sectorsPerStripeUnit);
+               return (EINVAL); 
+       }
+
        layoutPtr->stripeUnitsPerDisk = raidPtr->sectorsPerDisk / layoutPtr->sectorsPerStripeUnit;
 
        p = rf_GetLayout(parityConfig);



Home | Main Index | Thread Index | Old Index