diff options
| author | oster <oster@NetBSD.org> | 2008-12-20 17:04:51 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2008-12-20 17:04:51 +0000 |
| commit | 73225b15a57e8a02236a612f1bc77c83488fabb4 (patch) | |
| tree | d69ac4e9f39f51346bcf958360fd8c6ae4cca609 /sys/dev/raidframe | |
| parent | 9f442ba1cfa7ae6e2f5c55918599e55a400da8db (diff) | |
When unconfiguring an array where a reconstruct is in progress, abort
the reconstruct and wait for IOs to drain before pulling the plug.
Should fix the panic reported by der Mouse on tech-kern.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_driver.c | 15 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.c | 10 |
2 files changed, 20 insertions, 5 deletions
diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c index e7c17e18194..866db00cffc 100644 --- a/sys/dev/raidframe/rf_driver.c +++ b/sys/dev/raidframe/rf_driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_driver.c,v 1.119 2008/11/18 14:29:55 ad Exp $ */ +/* $NetBSD: rf_driver.c,v 1.120 2008/12/20 17:04:51 oster Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -66,7 +66,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.119 2008/11/18 14:29:55 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.120 2008/12/20 17:04:51 oster Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_diagnostic.h" @@ -225,11 +225,20 @@ rf_Shutdown(RF_Raid_t *raidPtr) /* Wait for any parity re-writes to stop... */ while (raidPtr->parity_rewrite_in_progress) { - printf("Waiting for parity re-write to exit...\n"); + printf("raid%d: Waiting for parity re-write to exit...\n", + raidPtr->raidid); tsleep(&raidPtr->parity_rewrite_in_progress, PRIBIO, "rfprwshutdown", 0); } + /* Wait for any reconstruction to stop... */ + while (raidPtr->reconInProgress) { + printf("raid%d: Waiting for reconstruction to stop...\n", + raidPtr->raidid); + tsleep(&raidPtr->waitForReconCond, PRIBIO, + "rfreshutdown",0); + } + raidPtr->valid = 0; rf_update_component_labels(raidPtr, RF_FINAL_COMPONENT_UPDATE); diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index 7ee21cab119..c89b5d0030e 100644 --- a/sys/dev/raidframe/rf_reconstruct.c +++ b/sys/dev/raidframe/rf_reconstruct.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.c,v 1.105 2008/09/23 21:36:35 oster Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.106 2008/12/20 17:04:51 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ ************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.105 2008/09/23 21:36:35 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.106 2008/12/20 17:04:51 oster Exp $"); #include <sys/param.h> #include <sys/time.h> @@ -626,6 +626,12 @@ rf_ContinueReconstructFailedDisk(RF_RaidReconDesc_t *reconDesc) done = 0; while (!done) { + if (raidPtr->waitShutdown) { + /* someone is unconfiguring this array... bail on the reconstruct.. */ + recon_error = 1; + break; + } + num_writes = 0; /* issue a read for each surviving disk */ |
