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 let the autodetection code get tripp...
details: https://anonhg.NetBSD.org/src/rev/3bba77ecdbb7
branches: trunk
changeset: 486807:3bba77ecdbb7
user: oster <oster%NetBSD.org@localhost>
date: Mon May 29 02:57:34 2000 +0000
description:
Don't let the autodetection code get tripped up by negative mod-counters.
diffstat:
sys/dev/raidframe/rf_disks.c | 26 +++++++++-----------------
sys/dev/raidframe/rf_netbsdkintf.c | 12 +++++++++---
2 files changed, 18 insertions(+), 20 deletions(-)
diffs (91 lines):
diff -r 001f13aaae60 -r 3bba77ecdbb7 sys/dev/raidframe/rf_disks.c
--- a/sys/dev/raidframe/rf_disks.c Mon May 29 02:16:57 2000 +0000
+++ b/sys/dev/raidframe/rf_disks.c Mon May 29 02:57:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_disks.c,v 1.29 2000/05/28 22:53:49 oster Exp $ */
+/* $NetBSD: rf_disks.c,v 1.30 2000/05/29 02:57:34 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -388,6 +388,7 @@
RF_AutoConfig_t *ac;
int parity_good;
int mod_counter;
+ int mod_counter_found;
#if DEBUG
printf("Starting autoconfiguration of RAID set...\n");
@@ -404,30 +405,21 @@
parity_good = RF_RAID_CLEAN;
/* Check for mod_counters that are too low */
- mod_counter = -1;
+ mod_counter_found = 0;
ac = auto_config;
while(ac!=NULL) {
- if (ac->clabel->mod_counter > mod_counter) {
+ if (mod_counter_found==0) {
mod_counter = ac->clabel->mod_counter;
+ mod_counter_found = 1;
+ } else {
+ if (ac->clabel->mod_counter > mod_counter) {
+ mod_counter = ac->clabel->mod_counter;
+ }
}
ac->flag = 0; /* clear the general purpose flag */
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++) {
diff -r 001f13aaae60 -r 3bba77ecdbb7 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Mon May 29 02:16:57 2000 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Mon May 29 02:57:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.86 2000/05/28 05:23:41 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.87 2000/05/29 02:57:35 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -3007,6 +3007,7 @@
int num_cols;
int num_missing;
int mod_counter;
+ int mod_counter_found;
/* check to see that we have enough 'live' components
of this set. If so, we can configure it if necessary */
@@ -3018,11 +3019,16 @@
/* Determine what the mod_counter is supposed to be for this set. */
- mod_counter = -1;
+ mod_counter_found = 0;
ac = cset->ac;
while(ac!=NULL) {
- if (ac->clabel->mod_counter > mod_counter) {
+ if (mod_counter_found==0) {
mod_counter = ac->clabel->mod_counter;
+ mod_counter_found = 1;
+ } else {
+ if (ac->clabel->mod_counter > mod_counter) {
+ mod_counter = ac->clabel->mod_counter;
+ }
}
ac = ac->next;
}
Home |
Main Index |
Thread Index |
Old Index