summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>1999-08-10 22:46:59 +0000
committeroster <oster@NetBSD.org>1999-08-10 22:46:59 +0000
commit620eda50c79b62febf3465bde4c8c3c04ab1d061 (patch)
tree168f9686ec4a4a3d18c5aff52876121bbcc3ace1 /sys/dev/raidframe
parent0b08c839eb5986aeb1a6032cef9c0edbee68a5f7 (diff)
Don't allow reconstructs, copybacks, or forced failures of components if
using a RAID 0, since RAID 0 can't handle those sorts of things.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index e7c8841290b..5f60e152ae6 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.23 1999/08/10 21:41:37 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.24 1999/08/10 22:46:59 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -1017,6 +1017,12 @@ raidioctl(dev, cmd, data, flag, p)
return(retcode);
case RAIDFRAME_REBUILD_IN_PLACE:
+
+ if (raidPtrs[unit]->Layout.map->faultsTolerated == 0) {
+ /* Can't do this on a RAID 0!! */
+ return(EINVAL);
+ }
+
componentPtr = (RF_SingleComponent_t *) data;
memcpy( &component, componentPtr,
sizeof(RF_SingleComponent_t));
@@ -1128,6 +1134,12 @@ raidioctl(dev, cmd, data, flag, p)
/* fail a disk & optionally start reconstruction */
case RAIDFRAME_FAIL_DISK:
+
+ if (raidPtrs[unit]->Layout.map->faultsTolerated == 0) {
+ /* Can't do this on a RAID 0!! */
+ return(EINVAL);
+ }
+
rr = (struct rf_recon_req *) data;
if (rr->row < 0 || rr->row >= raidPtrs[unit]->numRow
@@ -1154,6 +1166,12 @@ raidioctl(dev, cmd, data, flag, p)
/* invoke a copyback operation after recon on whatever disk
* needs it, if any */
case RAIDFRAME_COPYBACK:
+
+ if (raidPtrs[unit]->Layout.map->faultsTolerated == 0) {
+ /* This makes no sense on a RAID 0!! */
+ return(EINVAL);
+ }
+
/* borrow the current thread to get this done */
raidPtrs[unit]->proc = p; /* ICK.. but needed :-p GO */
s = splbio();
@@ -1163,6 +1181,11 @@ raidioctl(dev, cmd, data, flag, p)
/* return the percentage completion of reconstruction */
case RAIDFRAME_CHECKRECON:
+ if (raidPtrs[unit]->Layout.map->faultsTolerated == 0) {
+ /* This makes no sense on a RAID 0 */
+ return(EINVAL);
+ }
+
row = *(int *) data;
if (row < 0 || row >= raidPtrs[unit]->numRow)
return (EINVAL);