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=229958 --- 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 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) != 0. Meanwhile, another g_access() thread set gp->flags |= G_GEOM_IN_ACCESS and executed gp->access(). 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=0xfffff801630eb580, newtd=0xfffff80003ae1580, flags=<optimized out>) at sys/kern/sched_ule.c:2112 #1 mi_switch (flags=260, newtd=0x0) at sys/kern/kern_synch.c:439 #2 sleepq_switch (wchan=0xfffff8040afc2700, pri=0) at sys/kern/subr_sleepqueue.c:613 #3 sleepq_wait (wchan=0xfffff8040afc2700, pri=0) at sys/kern/subr_sleepqueue.c:692 #4 _sleep (ident=0xfffff8040afc2700, lock=<optimized out>, priority=0, wmesg=0xffffffff809042a5 "gtopol", sbt=<optimized out>, pr=0, flags=256) at sys/kern/kern_synch.c:217 #5 g_access (cp=0xfffff805da3f3a80, dcr=<optimized out>, dcw=0, dce=1) at sys/geom/geom_subr.c:932 #6 vdev_geom_attach (pp=0xfffff801ffe33800, vd=0x0, sanity=<optimized out>) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:278 #7 vdev_attach_ok (vd=0xfffff8054ca2e000, pp=0xfffff801ffe33800) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:650 #8 vdev_geom_attach_by_guids (vd=<optimized out>) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:722 #9 vdev_geom_open_by_guids (vd=<optimized out>) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:755 #10 vdev_geom_open (vd=0xfffff8054ca2e000, psize=0xfffffe01330aa168, max_psize=0xfffffe01330aa170, logical_ashift=0xfffffe01330aa158, physical_ashift=0xfffffe01330aa160) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:860 #11 vdev_open (vd=0xfffff8054ca2e000) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1550 #12 vdev_open_children (vd=0xfffff8054cbad000) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1478 #13 vdev_mirror_open (vd=0xfffff8054cbad000, asize=0xfffffe01330aa228, max_asize=0xfffffe01330aa230, logical_ashift=0xfffffe01330aa218, physical_ashift=0xfffffe01330aa220) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c:305 #14 vdev_open (vd=0xfffff8054cbad000) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1550 #15 vdev_open_children (vd=0xfffff8054c996000) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1478 #16 vdev_root_open (vd=0xfffff8054c996000, asize=0xfffffe01330aa308, max_asize=0xfffffe01330aa310, logical_ashift=0xfffffe01330aa2f8, physical_ashift=0xfffffe01330aa300) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c:96 #17 vdev_open (vd=0xfffff8054c996000) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c:1550 #18 spa_ld_open_vdevs (spa=0xfffffe013f864000) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:2564 #19 spa_ld_mos_init (spa=0xfffffe013f864000, type=SPA_IMPORT_EXISTING) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:3568 #20 spa_ld_mos_with_trusted_config (spa=0xfffffe013f864000, type=SPA_IMPORT_EXISTING, update_config_cache=0xfffffe01330aa514) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:3711 #21 spa_load_impl (spa=0xfffffe013f864000, type=SPA_IMPORT_EXISTING, ereport=<optimized out>) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:3765 #22 spa_load (spa=0xfffffe013f864000, state=<optimized out>, type=SPA_IMPORT_EXISTING) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:2348 #23 spa_tryimport (tryconfig=<optimized out>) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:5638 #24 zfs_ioc_pool_tryimport (zc=0xfffffe013c3d9000) 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=0xfffff80003d23000, newtd=0xfffff80003ad0000, flags=<optimized out>) at sys/kern/sched_ule.c:2112 2112 cpuid = PCPU_GET(cpuid); STACK: #0 sched_switch (td=0xfffff80003d23000, newtd=0xfffff80003ad0000, flags=<optimized out>) at sys/kern/sched_ule.c:2112 #1 mi_switch (flags=260, newtd=0x0) at sys/kern/kern_synch.c:439 #2 sleepq_switch (wchan=0xffffffff81cb39a8 <spa_namespace_lock>, pri=0) at sys/kern/subr_sleepqueue.c:613 #3 sleepq_wait (wchan=0xffffffff81cb39a8 <spa_namespace_lock>, pri=0) at sys/kern/subr_sleepqueue.c:692 #4 _sx_xlock_hard (sx=0xffffffff81cb39a8 <spa_namespace_lock>, x=<optimized out>, opts=<optimized out>, file=<optimized out>, line=<optimized out>) at sys/kern/kern_sx.c:857 #5 _sx_xlock (sx=0xffffffff81cb39a8 <spa_namespace_lock>, opts=0, file=0xffffffff81c09a5f "sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c", line=1276) at sys/kern/kern_sx.c:328 #6 zvol_close (flag=0, pp=<optimized out>, count=<optimized out>) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c:1276 #7 zvol_geom_access (pp=0xfffff801ffe33800, acr=<optimized out>, acw=<optimized out>, ace=0) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c:2739 #8 g_access (cp=0xfffff8052a7a3c00, dcr=<optimized out>, dcw=0, dce=0) at sys/geom/geom_subr.c:977 #9 g_label_taste (mp=0xffffffff80a7dfe0 <g_label_class>, pp=0xfffff801ffe33800, flags=<optimized out>) at sys/geom/label/g_label.c:392 #10 g_new_provider_event (arg=0xfffff801ffe33800, flag=<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=0xffffffff80481010 <g_event_procbody>, arg=0x0, frame=0xfffffe010e5a0ac0) at sys/kern/kern_fork.c:1057 #14 <signal handler called> PENDING ON LOCK: spa_namespace_lock, (struct sx *)0xffffffff81cb39a8 $7 = { lock_object = { lo_name = 0xffffffff81c26ae4, lo_flags = 0x22710000, lo_data = 0x0, lo_witness = 0x0 }, sx_lock = 0xfffff801630eb584 } LOCK HOLDER: (struct thread *)0xfffff801630eb580, tid 101829 zpool :: (struct proc *)0xfffff802e7bfca50, pid 39115 args: zpool import -- 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>
