summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>1998-12-03 15:14:40 +0000
committeroster <oster@NetBSD.org>1998-12-03 15:14:40 +0000
commit1b04131eff8a6f995f5bddbdd0c522a6bc77479c (patch)
tree960c9da90771bc20b3bf18064f5ddbdeba0154fc /sys/dev/raidframe
parent3f3d8e85e6d8c8d0d0ca9adbf4f6c67a152d2d95 (diff)
Try a bit harder to detect the physical failure of a component, and to
mark that component as dead. Physical failures are handled much better now.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 0becfc534c0..cf1edfcb9f2 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.3 1998/11/15 00:01:24 hubertf Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.4 1998/12/03 15:14:40 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -1580,6 +1580,21 @@ int rf_DispatchKernelIO(queue, req)
bp = req->bp;
+ /*
+ XXX when there is a physical disk failure, someone is passing
+ us a buffer that contains old stuff!! Attempt to deal with
+ this problem without taking a performance hit...
+ (not sure where the real bug is. It's buried in RAIDframe
+ somewhere) :-( GO )
+ */
+
+ if (bp->b_flags & B_ERROR) {
+ bp->b_flags &= ~B_ERROR;
+ }
+ if (bp->b_error!=0) {
+ bp->b_error = 0;
+ }
+
raidbp = RAIDGETBUF(rs);
raidbp->rf_flags = 0; /* XXX not really used anywhere... */
@@ -1713,9 +1728,32 @@ static void KernelWakeupFunc(vbp)
unit = queue->raidPtr->raidid; /* *Much* simpler :-> */
+
+ /* XXX Ok, let's get aggressive... If B_ERROR is set, let's go ballistic,
+ and mark the component as hosed... */
+#if 1
+ if (bp->b_flags&B_ERROR) {
+ /* Mark the disk as dead */
+ /* but only mark it once... */
+ if (queue->raidPtr->Disks[queue->row][queue->col].status ==
+ rf_ds_optimal) {
+ printf("raid%d: IO Error. Marking %s as failed.\n",
+ unit, queue->raidPtr->Disks[queue->row][queue->col].devname );
+ queue->raidPtr->Disks[queue->row][queue->col].status =
+ rf_ds_failed;
+ queue->raidPtr->status[queue->row] = rf_rs_degraded;
+ queue->raidPtr->numFailures++;
+ } else { /* Disk is already dead... */
+ /* printf("Disk already marked as dead!\n"); */
+ }
+
+ }
+#endif
+
rs = &raid_softc[unit];
RAIDPUTBUF(rs,raidbp);
+
if (bp->b_resid==0) {
db1_printf(("Disk is no longer busy for this buffer... %d %ld %ld\n",
unit, bp->b_resid, bp->b_bcount));