Abort any parity re-writes before unconfiguring a RAID set.

Partially addresses PR#10182.
This commit is contained in:
oster 2000-05-28 03:00:31 +00:00
parent 5108d90ce5
commit e38b4355e2
3 changed files with 20 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_driver.c,v 1.34 2000/03/07 02:28:05 oster Exp $ */
/* $NetBSD: rf_driver.c,v 1.35 2000/05/28 03:00:32 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@ -267,6 +267,13 @@ rf_Shutdown(raidPtr)
}
RF_FREELIST_DO_UNLOCK(rf_rad_freelist);
/* Wait for any parity re-writes to stop... */
while (raidPtr->parity_rewrite_in_progress) {
printf("Waiting for parity re-write to exit...\n");
tsleep(&raidPtr->parity_rewrite_in_progress, PRIBIO,
"rfprwshutdown", 0);
}
raidPtr->valid = 0;
rf_final_update_component_labels(raidPtr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_netbsdkintf.c,v 1.84 2000/05/28 01:03:22 oster Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.85 2000/05/28 03:00:31 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -2617,6 +2617,11 @@ rf_RewriteParityThread(raidPtr)
}
raidPtr->parity_rewrite_in_progress = 0;
/* Anyone waiting for us to stop? If so, inform them... */
if (raidPtr->waitShutdown) {
wakeup(&raidPtr->parity_rewrite_in_progress);
}
/* That's all... */
kthread_exit(0); /* does not return */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_parityscan.c,v 1.8 2000/01/05 02:57:28 oster Exp $ */
/* $NetBSD: rf_parityscan.c,v 1.9 2000/05/28 03:00:31 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -89,6 +89,11 @@ rf_RewriteParity(raidPtr)
for (i = 0; i < raidPtr->totalSectors &&
rc <= RF_PARITY_CORRECTED;
i += layoutPtr->dataSectorsPerStripe) {
if (raidPtr->waitShutdown) {
/* Someone is pulling the plug on this set...
abort the re-write */
return (1);
}
asm_h = rf_MapAccess(raidPtr, i,
layoutPtr->dataSectorsPerStripe,
NULL, RF_DONT_REMAP);