Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe sectorsPerStripeUnit should be larger than...



details:   https://anonhg.NetBSD.org/src/rev/e01513c45848
branches:  trunk
changeset: 474754:e01513c45848
user:      oster <oster%NetBSD.org@localhost>
date:      Mon Jul 19 01:35:19 1999 +0000

description:
sectorsPerStripeUnit should be larger than 0.  If it isn't, simply fail.
(Thanks to Thor Lancelot Simon for noting the problem).

diffstat:

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

diffs (23 lines):

diff -r 4fe528e77b4a -r e01513c45848 sys/dev/raidframe/rf_layout.c
--- a/sys/dev/raidframe/rf_layout.c     Mon Jul 19 00:42:59 1999 +0000
+++ b/sys/dev/raidframe/rf_layout.c     Mon Jul 19 01:35:19 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_layout.c,v 1.3 1999/02/05 00:06:12 oster Exp $      */
+/*     $NetBSD: rf_layout.c,v 1.4 1999/07/19 01:35:19 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -436,6 +436,13 @@
        layoutPtr->SUsPerRU = cfgPtr->SUsPerRU;
        parityConfig = cfgPtr->parityConfig;
 
+       if (layoutPtr->sectorsPerStripeUnit <= 0) {
+               RF_ERRORMSG2("raid%d: Invalid sectorsPerStripeUnit: %d\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