diff options
| author | oster <oster@NetBSD.org> | 2000-02-25 19:56:32 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2000-02-25 19:56:32 +0000 |
| commit | 503220a18fa69c8545fe183f38754d2c948eeb0f (patch) | |
| tree | c7cb9c9ad0f65de7ffac7b550d4393a1c6a609f9 /sys/dev/raidframe | |
| parent | ecf1c1eb2190365ef042632c09235daf1dd84529 (diff) | |
- ignore components whose mod_counter values are too low.
- noting the mod_counter for autoconfigured sets would be a win too.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_disks.c | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c index 9822b06f99d..4054db851b9 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.19 2000/02/24 03:48:41 oster Exp $ */ +/* $NetBSD: rf_disks.c,v 1.20 2000/02/25 19:56:32 oster Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -415,6 +415,7 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config) int force; RF_AutoConfig_t *ac; int parity_good; + int mod_counter; #if DEBUG printf("Starting autoconfiguration of RAID set...\n"); @@ -430,6 +431,29 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config) /* assume the parity will be fine.. */ parity_good = RF_RAID_CLEAN; + /* Check for mod_counters that are too low */ + mod_counter = -1; + ac = auto_config; + while(ac!=NULL) { + if (ac->clabel->mod_counter > mod_counter) { + mod_counter = ac->clabel->mod_counter; + } + ac = ac->next; + } + if (mod_counter == -1) { + /* mod_counters were all negative!?!?!? + Ok, we can deal with that. */ +#if 0 + ac = auto_config; + while(ac!=NULL) { + if (ac->clabel->mod_counter > mod_counter) { + mod_counter = ac->clabel->mod_counter; + } + ac = ac->next; + } +#endif + } + for (r = 0; r < raidPtr->numRow; r++) { numFailuresThisRow = 0; for (c = 0; c < raidPtr->numCol; c++) { @@ -452,6 +476,7 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config) printf("Found: %s at %d,%d\n", ac->devname,r,c); #endif + break; } ac=ac->next; @@ -500,13 +525,27 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config) for all components, guaranteed */ raidPtr->serial_number = ac->clabel->serial_number; - - if (ac->clabel->clean != RF_RAID_CLEAN) { - parity_good = RF_RAID_DIRTY; + /* check the last time the label + was modified */ + if (ac->clabel->mod_counter != + mod_counter) { + /* Even though we've filled in all + of the above, we don't trust + this component since it's + modification counter is not + in sync with the rest, and we really + consider it to be failed. */ + disks[r][c].status = rf_ds_failed; + numFailuresThisRow++; + } else { + if (ac->clabel->clean != + RF_RAID_CLEAN) { + parity_good = RF_RAID_DIRTY; + } } - } else { - /* Didn't find it!! Component must be dead */ + /* Didn't find it at all!! + Component must really be dead */ disks[r][c].status = rf_ds_failed; numFailuresThisRow++; } @@ -518,6 +557,8 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config) raidPtr->status[r] = rf_rs_degraded; } + raidPtr->mod_counter = mod_counter; + /* note the state of the parity, if any */ raidPtr->parity_good = parity_good; raidPtr->sectorsPerDisk = min_numblks; |
