summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2004-03-21 06:32:03 +0000
committeroster <oster@NetBSD.org>2004-03-21 06:32:03 +0000
commit3dd7f5503f6e72b22f85618ecd9d7b92741acee8 (patch)
treee4004de342fe5b60eaa8f451a980ec9e63513e40 /sys/dev/raidframe
parent492aa07868625e1c99b84bc41197599b04b7310a (diff)
Fix a nastly little bug that I've been chasing over the past 12 hours.
If raidPtr->numFailures isn't initialized properly, then all sorts of whacky things can happen, including incorrect DAGs being generated. (Triggering this problem is a little esoteric, which is why this bug has been in hiding for so long -- I only saw it after rebooting with a degraded RAID 5 set that was autoconfigured, rebuilding the failed componennt, and then failing the component while IO was happening to the RAID set.)
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_disks.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index 4677d19ae82..79657bd3f65 100644
--- a/sys/dev/raidframe/rf_disks.c
+++ b/sys/dev/raidframe/rf_disks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_disks.c,v 1.50 2004/03/13 03:32:08 oster Exp $ */
+/* $NetBSD: rf_disks.c,v 1.51 2004/03/21 06:32:03 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -67,7 +67,7 @@
***************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.50 2004/03/13 03:32:08 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.51 2004/03/21 06:32:03 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -524,8 +524,10 @@ rf_AutoConfigureDisks(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr,
/* XXX fix for n-fault tolerant */
/* XXX this should probably check to see how many failures
we can handle for this configuration! */
- if (numFailuresThisRow > 0)
+ if (numFailuresThisRow > 0) {
raidPtr->status = rf_rs_degraded;
+ raidPtr->numFailures = numFailuresThisRow;
+ }
/* close the device for the ones that didn't get used */
dule_hold/module_rele calls.haad 2009-01-02Return ENOSYS during from dm_target_init routine these tow targets aren'thaad 2009-01-02Add stubs for mirror target, too. This target does nothing for now, but lvmhaad