Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Be more aggressive about updating componen...



details:   https://anonhg.NetBSD.org/src/rev/c8698530e255
branches:  trunk
changeset: 482842:c8698530e255
user:      oster <oster%NetBSD.org@localhost>
date:      Wed Feb 23 03:44:02 2000 +0000

description:
Be more aggressive about updating component labels in the event
of a real component failure (or a simulated failure):
- add 'numNewFailures' to keep track of the number of disk failures
since mod_counter was last updated for each component label.
- make sure we call rf_update_component_labels() upon any component failure,
real or simulated.

diffstat:

 sys/dev/raidframe/rf_driver.c      |   5 ++++-
 sys/dev/raidframe/rf_netbsdkintf.c |  11 ++++++++++-
 sys/dev/raidframe/rf_raid.h        |   4 +++-
 sys/dev/raidframe/rf_reconstruct.c |   3 ++-
 4 files changed, 19 insertions(+), 4 deletions(-)

diffs (100 lines):

diff -r e6bbfada7a90 -r c8698530e255 sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c     Wed Feb 23 02:35:42 2000 +0000
+++ b/sys/dev/raidframe/rf_driver.c     Wed Feb 23 03:44:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_driver.c,v 1.29 2000/02/23 02:04:21 oster Exp $     */
+/*     $NetBSD: rf_driver.c,v 1.30 2000/02/23 03:44:02 oster Exp $     */
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -516,6 +516,7 @@
                }
        }
 
+       raidPtr->numNewFailures = 0;
        raidPtr->copyback_in_progress = 0;
        raidPtr->parity_rewrite_in_progress = 0;
        raidPtr->recon_in_progress = 0;
@@ -756,6 +757,7 @@
        raidPtr->numFailures++;
        raidPtr->Disks[row][col].status = rf_ds_dist_spared;
        raidPtr->status[row] = rf_rs_reconfigured;
+       rf_update_component_labels(raidPtr);
        /* install spare table only if declustering + distributed sparing
         * architecture. */
        if (raidPtr->Layout.map->flags & RF_BD_DECLUSTERED)
@@ -779,6 +781,7 @@
        raidPtr->numFailures++;
        raidPtr->Disks[frow][fcol].status = rf_ds_failed;
        raidPtr->status[frow] = rf_rs_degraded;
+       rf_update_component_labels(raidPtr);
        RF_UNLOCK_MUTEX(raidPtr->mutex);
        if (initRecon)
                rf_ReconstructFailedDisk(raidPtr, frow, fcol);
diff -r e6bbfada7a90 -r c8698530e255 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Wed Feb 23 02:35:42 2000 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Wed Feb 23 03:44:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.55 2000/02/23 02:11:05 oster Exp $        */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.56 2000/02/23 03:44:03 oster Exp $        */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -1537,6 +1537,14 @@
        unit = raidPtr->raidid;
        rs = &raid_softc[unit];
        
+       /* quick check to see if anything has died recently */
+       RF_LOCK_MUTEX(raidPtr->mutex);
+       if (raidPtr->numNewFailures > 0) {
+               rf_update_component_labels(raidPtr);
+               raidPtr->numNewFailures--;
+       }
+       RF_UNLOCK_MUTEX(raidPtr->mutex);
+
        /* Check to see if we're at the limit... */
        RF_LOCK_MUTEX(raidPtr->mutex);
        while (raidPtr->openings > 0) {
@@ -1811,6 +1819,7 @@
                            rf_ds_failed;
                        queue->raidPtr->status[queue->row] = rf_rs_degraded;
                        queue->raidPtr->numFailures++;
+                       queue->raidPtr->numNewFailures++;
                        /* XXX here we should bump the version number for each component, and write that data out */
                } else {        /* Disk is already dead... */
                        /* printf("Disk already marked as dead!\n"); */
diff -r e6bbfada7a90 -r c8698530e255 sys/dev/raidframe/rf_raid.h
--- a/sys/dev/raidframe/rf_raid.h       Wed Feb 23 02:35:42 2000 +0000
+++ b/sys/dev/raidframe/rf_raid.h       Wed Feb 23 03:44:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_raid.h,v 1.10 2000/02/23 02:04:21 oster Exp $       */
+/*     $NetBSD: rf_raid.h,v 1.11 2000/02/23 03:44:02 oster Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -132,6 +132,8 @@
        RF_LockTableEntry_t *lockTable; /* stripe-lock table */
        RF_LockTableEntry_t *quiesceLock;       /* quiesnce table */
        int     numFailures;    /* total number of failures in the array */
+       int     numNewFailures; /* number of *new* failures (that havn't 
+                                  caused a mod_counter update */
 
        int     parity_good;    /* !0 if parity is known to be correct */
        int     serial_number;  /* a "serial number" for this set */
diff -r e6bbfada7a90 -r c8698530e255 sys/dev/raidframe/rf_reconstruct.c
--- a/sys/dev/raidframe/rf_reconstruct.c        Wed Feb 23 02:35:42 2000 +0000
+++ b/sys/dev/raidframe/rf_reconstruct.c        Wed Feb 23 03:44:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_reconstruct.c,v 1.16 2000/02/23 02:03:03 oster Exp $        */
+/*     $NetBSD: rf_reconstruct.c,v 1.17 2000/02/23 03:44:03 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -434,6 +434,7 @@
                        raidPtr->numFailures++;
                        raidPtr->Disks[row][col].status = rf_ds_failed;
                        raidPtr->status[row] = rf_rs_degraded;
+                       rf_update_component_labels(raidPtr);
                }
 
                while (raidPtr->reconInProgress) {



Home | Main Index | Thread Index | Old Index