Fix a lock order reversal in uma_zdestroy. The uma_mtx needs to be held across

calls to zone_drain().

Noticed by:	scottl
This commit is contained in:
Jeff Roberson 2002-07-05 21:39:52 +00:00
parent 89b2e0c349
commit 17b9cc4941
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99472

View File

@ -1123,15 +1123,15 @@ zone_dtor(void *arg, int size, void *udata)
zone = (uma_zone_t)arg;
mtx_lock(&uma_mtx);
LIST_REMOVE(zone, uz_link);
mtx_unlock(&uma_mtx);
ZONE_LOCK(zone);
zone->uz_wssize = 0;
ZONE_UNLOCK(zone);
mtx_lock(&uma_mtx);
LIST_REMOVE(zone, uz_link);
zone_drain(zone);
mtx_unlock(&uma_mtx);
ZONE_LOCK(zone);
if (zone->uz_free != 0)
printf("Zone %s was not empty. Lost %d pages of memory.\n",