summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2001-02-02 07:14:13 +0000
committergrog <grog@FreeBSD.org>2001-02-02 07:14:13 +0000
commite6bd7f7c6d1d8a84684b1b83f687d53ddd55c478 (patch)
treeb614f35fa91b479a69b5689edc36cf0365ac0627 /sys/dev
parent5dfebcc02e3145f96743725b0cb27702796d50fd (diff)
downloadFreeBSD-src-e6bd7f7c6d1d8a84684b1b83f687d53ddd55c478.zip
FreeBSD-src-e6bd7f7c6d1d8a84684b1b83f687d53ddd55c478.tar.gz
Allocate lock table and mutex not only for parity plexes, but also for
striped plexes. This prevents various panics introduced in the last rewrite of the locking code. Suffered by: "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/vinum/vinumconfig.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
index 51f8de3..b32607d 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/dev/vinum/vinumconfig.c
@@ -1396,12 +1396,12 @@ config_plex(int update)
sprintf(plexsuffix, ".p%d", pindex); /* form the suffix */
strcat(plex->name, plexsuffix); /* and add it to the name */
}
- if (isparity(plex)) {
+ if (isstriped (plex)) {
plex->lock = (struct rangelock *)
Malloc(PLEX_LOCKS * sizeof(struct rangelock));
CHECKALLOC(plex->lock, "vinum: Can't allocate lock table\n");
bzero((char *) plex->lock, PLEX_LOCKS * sizeof(struct rangelock));
- mtx_init(&plex->lockmtx, plex->name, MTX_DEF);
+ mtx_init(&plex->lockmtx, plex->name, MTX_DEF);
}
/* Note the last plex we configured */
current_plex = plexno;
@@ -1784,7 +1784,7 @@ remove_plex_entry(int plexno, int force, int recurse)
}
}
log(LOG_INFO, "vinum: removing %s\n", plex->name);
- if (isparity(plex))
+ if (isstriped(plex))
mtx_destroy(&plex->lockmtx);
free_plex(plexno);
vinum_conf.plexes_used--; /* one less plex */
OpenPOWER on IntegriCloud