summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2000-05-29 02:57:34 +0000
committeroster <oster@NetBSD.org>2000-05-29 02:57:34 +0000
commitc11100526b0e49e561ccccbd56c10bb18f40d2cd (patch)
treec3a14b9e9c5c6ac8b3798f38aafb621508c529a5 /sys/dev/raidframe
parentc7c33f1747805d87b9e5ec77053e2e683330855a (diff)
Don't let the autodetection code get tripped up by negative mod-counters.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_disks.c24
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c12
2 files changed, 17 insertions, 19 deletions
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index 8c3a25e5fc1..cd15625830f 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.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_AutoConfigureDisks(raidPtr, cfgPtr, auto_config)
RF_AutoConfig_t *ac;
int parity_good;
int mod_counter;
+ int mod_counter_found;
#if DEBUG
printf("Starting autoconfiguration of RAID set...\n");
@@ -404,28 +405,19 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config)
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;
- }
- 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) {
+ mod_counter_found = 1;
+ } else {
if (ac->clabel->mod_counter > mod_counter) {
mod_counter = ac->clabel->mod_counter;
}
- ac = ac->next;
}
-#endif
+ ac->flag = 0; /* clear the general purpose flag */
+ ac = ac->next;
}
for (r = 0; r < raidPtr->numRow; r++) {
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 4a95609f2a4..f2e556f9d68 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.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 @@ rf_have_enough_components(cset)
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 @@ rf_have_enough_components(cset)
/* 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;
}