Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/dev/raidframe pull up rev 1.24 from trunk (requeste...



details:   https://anonhg.NetBSD.org/src/rev/6b7e79c8c4d8
branches:  netbsd-1-4
changeset: 469517:6b7e79c8c4d8
user:      cgd <cgd%NetBSD.org@localhost>
date:      Tue Sep 28 04:46:28 1999 +0000

description:
pull up rev 1.24 from trunk (requested by oster):
  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:

 sys/dev/raidframe/rf_netbsdkintf.c |  25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diffs (60 lines):

diff -r e7930199e0b6 -r 6b7e79c8c4d8 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Mon Sep 27 06:03:04 1999 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Tue Sep 28 04:46:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.16.2.5 1999/09/27 05:04:10 cgd Exp $      */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.16.2.6 1999/09/28 04:46:28 cgd Exp $      */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -1014,6 +1014,12 @@
                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));
@@ -1123,6 +1129,12 @@
 
                /* 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
@@ -1149,6 +1161,12 @@
                /* 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();
@@ -1158,6 +1176,11 @@
 
                /* 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);



Home | Main Index | Thread Index | Old Index