1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-26 07:55:01 +00:00

Avoid the GEOM topology lock recursion when we automatically expand a pool.

The steps to reproduce the problem:

	mdconfig -a -t swap -s 3g -u 0
	gpart create -s GPT md0
	gpart add -t freebsd-zfs -s 1g md0
	zpool create -o autoexpand=on foo md0p1
	gpart resize -i 1 -s 2g md0
This commit is contained in:
Pawel Jakub Dawidek 2020-04-25 21:45:31 +00:00
parent cefbc0d19b
commit cb761bb2fb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360325

View File

@ -973,18 +973,22 @@ static void
vdev_geom_close(vdev_t *vd)
{
struct g_consumer *cp;
int locked;
cp = vd->vdev_tsd;
DROP_GIANT();
g_topology_lock();
locked = g_topology_locked();
if (!locked)
g_topology_lock();
if (!vd->vdev_reopening ||
(cp != NULL && ((cp->flags & G_CF_ORPHAN) != 0 ||
(cp->provider != NULL && cp->provider->error != 0))))
vdev_geom_close_locked(vd);
g_topology_unlock();
if (!locked)
g_topology_unlock();
PICKUP_GIANT();
}