summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2000-05-28 03:00:31 +0000
committeroster <oster@NetBSD.org>2000-05-28 03:00:31 +0000
commite38b4355e24b69b4bee7b8ee582b81480b512d1b (patch)
tree330023eddcda82421ced3ac7dfb9714c701603dc /sys/dev/raidframe
parent5108d90ce5ff83c23e91f199ac254a9d5f20febb (diff)
Abort any parity re-writes before unconfiguring a RAID set.
Partially addresses PR#10182.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_driver.c9
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c7
-rw-r--r--sys/dev/raidframe/rf_parityscan.c7
3 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c
index 43133fa98ca..cea81fb4583 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.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);
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 3b19cd6f08c..c3ce585f023 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.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 */
}
diff --git a/sys/dev/raidframe/rf_parityscan.c b/sys/dev/raidframe/rf_parityscan.c
index 5e666e0b59e..31505e0956b 100644
--- a/sys/dev/raidframe/rf_parityscan.c
+++ b/sys/dev/raidframe/rf_parityscan.c
@@ -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);