Skip to content

Commit

Permalink
Avoid the GEOM topology lock recursion when we automatically expand a…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
pjd authored and pjd committed Apr 25, 2020
1 parent c41a141 commit bccd2db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit bccd2db

Please sign in to comment.