Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Don't allow -f to fail a disk while a reco...



details:   https://anonhg.NetBSD.org/src/rev/777af6d23d83
branches:  trunk
changeset: 571307:777af6d23d83
user:      oster <oster%NetBSD.org@localhost>
date:      Wed Nov 17 01:34:10 2004 +0000

description:
Don't allow -f to fail a disk while a reconstruction is taking place
since that would cause a panic.  (Problem noticed by dan@.)

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r cd999852e6d0 -r 777af6d23d83 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Wed Nov 17 00:33:45 2004 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Wed Nov 17 01:34:10 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.184 2004/11/16 16:52:30 oster Exp $       */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.185 2004/11/17 01:34:10 oster Exp $       */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -146,7 +146,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.184 2004/11/16 16:52:30 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.185 2004/11/17 01:34:10 oster Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -1285,6 +1285,12 @@
 
 
                RF_LOCK_MUTEX(raidPtr->mutex);
+               if (raidPtr->status == rf_rs_reconstructing) {
+                       /* you can't fail a disk while we're reconstructing! */
+                       /* XXX wrong for RAID6 */
+                       RF_UNLOCK_MUTEX(raidPtr->mutex);
+                       return (EINVAL);
+               }
                if ((raidPtr->Disks[rr->col].status == 
                     rf_ds_optimal) && (raidPtr->numFailures > 0)) { 
                        /* some other component has failed.  Let's not make



Home | Main Index | Thread Index | Old Index