summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2001-07-16 15:50:27 +0000
committeroster <oster@NetBSD.org>2001-07-16 15:50:27 +0000
commit81f5c58b58fd5fe8391d33e96a20616cc26bb9e5 (patch)
treec39fcece1a8613da8e4a76206039c872f0419052 /sys/dev/raidframe
parentf82d5c6424a1e57dd7ce3e00e9a276e634d463fe (diff)
If we're closing the last partition on a RAID set and the system is
being shutdown, then unconfigure the RAID set too. This fixes a number of issues with doing proper unconfigures/shutdowns of multi-level RAID sets. Thanks to Jason Thorpe and Bill Squier for the ideas/suggestions on how/where to do this, and to Bill Squier for testing.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index b5a5c00d759..63ca0a09c4a 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.106 2001/06/21 03:07:04 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.107 2001/07/16 15:50:27 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -636,6 +636,18 @@ raidclose(dev, flags, fmt, p)
#endif
rf_update_component_labels(raidPtrs[unit],
RF_FINAL_COMPONENT_UPDATE);
+ if (doing_shutdown) {
+ /* last one, and we're going down, so
+ lights out for this RAID set too. */
+ error = rf_Shutdown(raidPtrs[unit]);
+ pool_destroy(&rs->sc_cbufpool);
+
+ /* It's no longer initialized... */
+ rs->sc_flags &= ~RAIDF_INITED;
+
+ /* Detach the disk. */
+ disk_detach(&rs->sc_dkdev);
+ }
}
raidunlock(rs);