Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2019 19:43:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        fs@FreeBSD.org
Subject:   [Bug 229958] ctld / zfs deadlock with 'zfs rename ...'
Message-ID:  <bug-229958-3630-3sjyrsocwL@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-229958-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-229958-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229958

--- Comment #10 from Dave Baukus <daveb@spectralogic.com> ---
Here's another twist on the same theme.
The theme being that serializing zvol.c by overloading the=20
spa_namespace_lock is specious at best.

This time, deadlkres() panicked the system because we have
zpool import thread holding the spa_namespace_lock while sleeping
in g_access() waiting for (gp->flags & G_GEOM_IN_ACCESS) !=3D 0.

Meanwhile, another g_access() thread  set=20
gp->flags |=3D G_GEOM_IN_ACCESS and executed gp->access().=20
In this case gp->access is zvol_geom_access().
zvol_geom_access() executes zvol_close() where it tries to acquire
the spa_namespace_lock - Deadlock.

Details below:

Thread 1666 (Thread 101829):
(struct thread *)0xfffff801630eb580, tid 101829
   zpool :: (struct proc *)0xfffff802e7bfca50, pid 39115
   args: zpool import

[Switching to thread 1666 (Thread 101829)]
STACK:
#0  sched_switch (td=3D0xfffff801630eb580, newtd=3D0xfffff80003ae1580,
flags=3D<optimized out>) at sys/kern/sched_ule.c:2112
#1  mi_switch (flags=3D260, newtd=3D0x0) at sys/kern/kern_synch.c:439
#2  sleepq_switch (wchan=3D0xfffff8040afc2700, pri=3D0) at
sys/kern/subr_sleepqueue.c:613
#3  sleepq_wait (wchan=3D0xfffff8040afc2700, pri=3D0) at
sys/kern/subr_sleepqueue.c:692
#4  _sleep (ident=3D0xfffff8040afc2700, lock=3D<optimized out>, priority=3D=
0,
wmesg=3D0xffffffff809042a5 "gtopol", sbt=3D<optimized out>, pr=3D0, flags=
=3D256) at
sys/kern/kern_synch.c:217
#5  g_access (cp=3D0xfffff805da3f3a80, dcr=3D<optimized out>, dcw=3D0, dce=
=3D1) at
sys/geom/geom_subr.c:932
#6  vdev_geom_attach (pp=3D0xfffff801ffe33800, vd=3D0x0, sanity=3D<optimize=
d out>) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:278
#7  vdev_attach_ok (vd=3D0xfffff8054ca2e000, pp=3D0xfffff801ffe33800) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:650
#8  vdev_geom_attach_by_guids (vd=3D<optimized out>) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:722
#9  vdev_geom_open_by_guids (vd=3D<optimized out>) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:755
#10 vdev_geom_open (vd=3D0xfffff8054ca2e000, psize=3D0xfffffe01330aa168,
max_psize=3D0xfffffe01330aa170, logical_ashift=3D0xfffffe01330aa158,
physical_ashift=3D0xfffffe01330aa160) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:860
#11 vdev_open (vd=3D0xfffff8054ca2e000) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1550
#12 vdev_open_children (vd=3D0xfffff8054cbad000) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1478
#13 vdev_mirror_open (vd=3D0xfffff8054cbad000, asize=3D0xfffffe01330aa228,
max_asize=3D0xfffffe01330aa230, logical_ashift=3D0xfffffe01330aa218,
physical_ashift=3D0xfffffe01330aa220) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c:305
#14 vdev_open (vd=3D0xfffff8054cbad000) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1550
#15 vdev_open_children (vd=3D0xfffff8054c996000) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1478
#16 vdev_root_open (vd=3D0xfffff8054c996000, asize=3D0xfffffe01330aa308,
max_asize=3D0xfffffe01330aa310, logical_ashift=3D0xfffffe01330aa2f8,
physical_ashift=3D0xfffffe01330aa300) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c:96
#17 vdev_open (vd=3D0xfffff8054c996000) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1550
#18 spa_ld_open_vdevs (spa=3D0xfffffe013f864000) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:2564
#19 spa_ld_mos_init (spa=3D0xfffffe013f864000, type=3DSPA_IMPORT_EXISTING) =
at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:3568
#20 spa_ld_mos_with_trusted_config (spa=3D0xfffffe013f864000,
type=3DSPA_IMPORT_EXISTING, update_config_cache=3D0xfffffe01330aa514) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:3711
#21 spa_load_impl (spa=3D0xfffffe013f864000, type=3DSPA_IMPORT_EXISTING,
ereport=3D<optimized out>) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:3765
#22 spa_load (spa=3D0xfffffe013f864000, state=3D<optimized out>,
type=3DSPA_IMPORT_EXISTING) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:2348
#23 spa_tryimport (tryconfig=3D<optimized out>) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:5638
#24 zfs_ioc_pool_tryimport (zc=3D0xfffffe013c3d9000) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c:1756

--------------------------------------------

Thread 1328 (Thread 100162):
(struct thread *)0xfffff80003d23000, tid 100162
   geom :: (struct proc *)0xfffff80003da8a50, pid 13

#0  sched_switch (td=3D0xfffff80003d23000, newtd=3D0xfffff80003ad0000,
flags=3D<optimized out>) at sys/kern/sched_ule.c:2112
2112                    cpuid =3D PCPU_GET(cpuid);

STACK:
#0  sched_switch (td=3D0xfffff80003d23000, newtd=3D0xfffff80003ad0000,
flags=3D<optimized out>) at sys/kern/sched_ule.c:2112
#1  mi_switch (flags=3D260, newtd=3D0x0) at sys/kern/kern_synch.c:439
#2  sleepq_switch (wchan=3D0xffffffff81cb39a8 <spa_namespace_lock>, pri=3D0=
) at
sys/kern/subr_sleepqueue.c:613
#3  sleepq_wait (wchan=3D0xffffffff81cb39a8 <spa_namespace_lock>, pri=3D0) =
at
sys/kern/subr_sleepqueue.c:692
#4  _sx_xlock_hard (sx=3D0xffffffff81cb39a8 <spa_namespace_lock>, x=3D<opti=
mized
out>, opts=3D<optimized out>, file=3D<optimized out>, line=3D<optimized out=
>) at
sys/kern/kern_sx.c:857
#5  _sx_xlock (sx=3D0xffffffff81cb39a8 <spa_namespace_lock>, opts=3D0,
file=3D0xffffffff81c09a5f
"sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c", line=3D1276) at
sys/kern/kern_sx.c:328
#6  zvol_close (flag=3D0, pp=3D<optimized out>, count=3D<optimized out>) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c:1276
#7  zvol_geom_access (pp=3D0xfffff801ffe33800, acr=3D<optimized out>,
acw=3D<optimized out>, ace=3D0) at
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c:2739
#8  g_access (cp=3D0xfffff8052a7a3c00, dcr=3D<optimized out>, dcw=3D0, dce=
=3D0) at
sys/geom/geom_subr.c:977
#9  g_label_taste (mp=3D0xffffffff80a7dfe0 <g_label_class>,
pp=3D0xfffff801ffe33800, flags=3D<optimized out>) at sys/geom/label/g_label=
.c:392
#10 g_new_provider_event (arg=3D0xfffff801ffe33800, flag=3D<optimized out>)=
 at
sys/geom/geom_subr.c:557
#11 one_event () at sys/geom/geom_event.c:268
#12 g_run_events () at sys/geom/geom_event.c:291
#13 fork_exit (callout=3D0xffffffff80481010 <g_event_procbody>, arg=3D0x0,
frame=3D0xfffffe010e5a0ac0) at sys/kern/kern_fork.c:1057
#14 <signal handler called>

PENDING ON LOCK:
spa_namespace_lock, (struct sx *)0xffffffff81cb39a8
$7 =3D {
  lock_object =3D {
    lo_name =3D 0xffffffff81c26ae4,
    lo_flags =3D 0x22710000,
    lo_data =3D 0x0,
    lo_witness =3D 0x0
  },
  sx_lock =3D 0xfffff801630eb584
}
LOCK HOLDER:
(struct thread *)0xfffff801630eb580, tid 101829
   zpool :: (struct proc *)0xfffff802e7bfca50, pid 39115
   args: zpool import

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229958-3630-3sjyrsocwL>