summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2000-04-16 03:24:26 +0000
committeroster <oster@NetBSD.org>2000-04-16 03:24:26 +0000
commitc71398f7a90f33a721b9541f04b7164d754db672 (patch)
treeb49ff082831bf0a7666bb36c09b8ee0ed79d4540 /sys/dev/raidframe
parent95e706c931ef3ef81087b067e9eff367fa3c6462 (diff)
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 (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_layout.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_layout.c b/sys/dev/raidframe/rf_layout.c
index 74a468f9d6c..0a5da4059bd 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.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 @@ rf_ConfigureLayout(
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);