summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-10-05 03:33:38 +0000
committerrwatson <rwatson@FreeBSD.org>2002-10-05 03:33:38 +0000
commitfc6cf98e7909a70a0e94a4b1863730932292d105 (patch)
tree996f1faef309becb278398afb708b1e055f70737 /sys/dev/vinum
parenta648bd3f5356ec601d2e174ac00895ae37fa9bcb (diff)
downloadFreeBSD-src-fc6cf98e7909a70a0e94a4b1863730932292d105.zip
FreeBSD-src-fc6cf98e7909a70a0e94a4b1863730932292d105.tar.gz
Refinement on previous fix for mutex destruction: make sure we don't
release the mutex multiple times for multi-plex volumes. Following further consultation with: grog
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinumconfig.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
index 85c545d..bfc8c06 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/dev/vinum/vinumconfig.c
@@ -726,7 +726,6 @@ return_drive_space(int driveno, int64_t offset, int length)
void
free_sd(int sdno)
{
- struct plex *plex = &PLEX[sdno];
struct sd *sd;
sd = &SD[sdno];
@@ -736,9 +735,7 @@ free_sd(int sdno)
sd->driveoffset,
sd->sectors);
if (sd->plexno >= 0)
- plex->subdisks--; /* one less subdisk */
- if (isstriped (plex))
- mtx_destroy(&plex->lockmtx);
+ PLEX[sd->plexno].subdisks--; /* one less subdisk */
destroy_dev(sd->dev);
bzero(sd, sizeof(struct sd)); /* and clear it out */
sd->state = sd_unallocated;
@@ -817,6 +814,8 @@ free_plex(int plexno)
Free(plex->sdnos);
if (plex->lock)
Free(plex->lock);
+ if (isstriped (plex))
+ mtx_destroy(&plex->lockmtx);
destroy_dev(plex->dev);
bzero(plex, sizeof(struct plex)); /* and clear it out */
plex->state = plex_unallocated;
OpenPOWER on IntegriCloud