summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>1999-07-19 01:35:19 +0000
committeroster <oster@NetBSD.org>1999-07-19 01:35:19 +0000
commit0c7600ca4e55056e74fdc9b41069429c6bec0438 (patch)
tree22d8b2f845a9429b620de460bc665060a3650471 /sys/dev/raidframe
parentccb3350fe4b6571a6694ca5f220de6f974fe7390 (diff)
sectorsPerStripeUnit should be larger than 0. If it isn't, simply fail.
(Thanks to Thor Lancelot Simon for noting the problem).
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_layout.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_layout.c b/sys/dev/raidframe/rf_layout.c
index 8474f6c7093..74a468f9d6c 100644
--- a/sys/dev/raidframe/rf_layout.c
+++ b/sys/dev/raidframe/rf_layout.c
@@ -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 @@ rf_ConfigureLayout(
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);