Don't let the autodetection code get tripped up by negative mod-counters.
This commit is contained in:
parent
c7c33f1747
commit
c11100526b
|
@ -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.
|
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -388,6 +388,7 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config)
|
||||||
RF_AutoConfig_t *ac;
|
RF_AutoConfig_t *ac;
|
||||||
int parity_good;
|
int parity_good;
|
||||||
int mod_counter;
|
int mod_counter;
|
||||||
|
int mod_counter_found;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
printf("Starting autoconfiguration of RAID set...\n");
|
printf("Starting autoconfiguration of RAID set...\n");
|
||||||
|
@ -404,28 +405,19 @@ rf_AutoConfigureDisks(raidPtr, cfgPtr, auto_config)
|
||||||
parity_good = RF_RAID_CLEAN;
|
parity_good = RF_RAID_CLEAN;
|
||||||
|
|
||||||
/* Check for mod_counters that are too low */
|
/* Check for mod_counters that are too low */
|
||||||
mod_counter = -1;
|
mod_counter_found = 0;
|
||||||
ac = auto_config;
|
ac = auto_config;
|
||||||
while(ac!=NULL) {
|
while(ac!=NULL) {
|
||||||
if (ac->clabel->mod_counter > mod_counter) {
|
if (mod_counter_found==0) {
|
||||||
mod_counter = ac->clabel->mod_counter;
|
mod_counter = ac->clabel->mod_counter;
|
||||||
}
|
mod_counter_found = 1;
|
||||||
ac->flag = 0; /* clear the general purpose flag */
|
} else {
|
||||||
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) {
|
if (ac->clabel->mod_counter > mod_counter) {
|
||||||
mod_counter = ac->clabel->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++) {
|
for (r = 0; r < raidPtr->numRow; r++) {
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -3007,6 +3007,7 @@ rf_have_enough_components(cset)
|
||||||
int num_cols;
|
int num_cols;
|
||||||
int num_missing;
|
int num_missing;
|
||||||
int mod_counter;
|
int mod_counter;
|
||||||
|
int mod_counter_found;
|
||||||
|
|
||||||
/* check to see that we have enough 'live' components
|
/* check to see that we have enough 'live' components
|
||||||
of this set. If so, we can configure it if necessary */
|
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. */
|
/* Determine what the mod_counter is supposed to be for this set. */
|
||||||
|
|
||||||
mod_counter = -1;
|
mod_counter_found = 0;
|
||||||
ac = cset->ac;
|
ac = cset->ac;
|
||||||
while(ac!=NULL) {
|
while(ac!=NULL) {
|
||||||
if (ac->clabel->mod_counter > mod_counter) {
|
if (mod_counter_found==0) {
|
||||||
mod_counter = ac->clabel->mod_counter;
|
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;
|
ac = ac->next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue