Date: Wed, 12 Dec 2018 18:21:54 +0000 From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 229958] ctld / zfs deadlock with 'zfs rename ...' Message-ID: <bug-229958-3630-RkiLN5TnD6@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 #8 from Dave Baukus <daveb@spectralogic.com> --- (In reply to Andriy Gapon from comment #7) I have several deadlocks that all involve zvol and the spa_namespace_lock; = the following does not involve a rename: spa_namespace_lock lock holder blocked on the dp->dp_config_rwlock ------------------------------------------------------------------ Thread 1745 (Thread 100163): (struct thread *)0xfffff80003cdc580, tid 100163 geom :: (struct proc *)0xfffff80003d6ba50, pid 13 STACK: #0 sched_switch (td=3D0xfffff80003cdc580, newtd=3D0xfffff80003acf580, flags=3D<optimized out>) at sys/kern/sched_ule.c:2112 #1 0xffffffff80513d6f in mi_switch (flags=3D260, newtd=3D0x0) at sys/kern/kern_synch.c:439 #2 0xffffffff8055e04d in sleepq_switch (wchan=3D0xfffff80e53a8ecc8, pri=3D= 0) at sys/kern/subr_sleepqueue.c:613 #3 0xffffffff8055def3 in sleepq_wait (wchan=3D0xfffff80e53a8ecc8, pri=3D0)= at sys/kern/subr_sleepqueue.c:692 #4 0xffffffff804a4b73 in _cv_wait (cvp=3D0xfffff80e53a8ecc8, lock=3D<optim= ized out>) at sys/kern/kern_condvar.c:146 #5 0xffffffff8183a54b in rrw_enter_read_impl (rrl=3D0xfffff80e53a8eca8, pr= io=3D0, tag=3D0xffffffff8190d1da) at fs/zfs/rrwlock.c:181 #6 0xffffffff8181eb17 in dsl_pool_config_enter (dp=3D<optimized out>, tag=3D0xffffffff8190d1da) at fs/zfs/dsl_pool.c:1338 #7 dsl_pool_hold (name=3D<optimized out>, tag=3D0xffffffff8190d1da, dp=3D0xfffffe010e5a9848) at fs/zfs/dsl_pool.c:1310 #8 0xffffffff817f8991 in dmu_objset_hold (name=3D0xfffff80546b1a810 "testpool.1470/newvol", tag=3D0xffffffff8190d1da, osp=3D0xfffffe010e5a9888)= at fs/zfs/dmu_objset.c:626 #9 0xffffffff81823138 in dsl_prop_get (dsname=3D<unavailable>, propname=3D0xffffffff8192fda6 "readonly", intsz=3D8, numints=3D1, buf=3D<op= timized out>, setpoint=3D0x0) at fs/zfs/dsl_prop.c:320 #10 dsl_prop_get_integer (ddname=3D<unavailable>, propname=3D0xffffffff8192= fda6 "readonly", valuep=3D0xfffffe010e5a9908, setpoint=3D0x0) at fs/zfs/dsl_prop= .c:343 #11 0xffffffff818dc3fc in zvol_first_open (zv=3D0xfffff80546b1a800) at fs/zfs/zvol.c:880 #12 0xffffffff818dbdbb in zvol_open (pp=3D<optimized out>, count=3D<optimiz= ed out>, flag=3D<optimized out>) at fs/zfs/zvol.c:1198 #13 zvol_geom_access (pp=3D0xfffff8062add8c00, acr=3D<optimized out>, acw= =3D0, ace=3D<optimized out>) at fs/zfs/zvol.c:2737 #14 0xffffffff804809f9 in g_access (cp=3D0xfffff804ef224000, dcr=3D<optimiz= ed out>, dcw=3D0, dce=3D0) at sys/geom/geom_subr.c:977 #15 0xffffffff80486974 in g_part_taste (mp=3D0xffffffff80a7ebf0 <g_part_cla= ss>, pp=3D0xfffff8062add8c00, flags=3D<optimized out>) at sys/geom/part/g_part.c= :1982 #16 0xffffffff8048158a in g_new_provider_event (arg=3D0xfffff8062add8c00, flag=3D<optimized out>) at sys/geom/geom_subr.c:557 #17 0xffffffff8047c3b4 in one_event () at sys/geom/geom_event.c:268 #18 g_run_events () at sys/geom/geom_event.c:291 #19 0xffffffff804ca144 in fork_exit (callout=3D0xffffffff8047e720 <g_event_procbody>, arg=3D0x0, frame=3D0xfffffe010e5a9ac0) at sys/kern/kern_fork.c:1057 #20 <signal handler called> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The spa sync thread blocked on the spa_namespace_lock lock:=20 ------------------------------------------------------------ Thread 1774 (Thread 104418): (struct thread *)0xfffff807bb1af580, tid 104418 zfskern :: (struct proc *)0xfffff80005942528, pid 15 STACK: #0 sched_switch (td=3D0xfffff807bb1af580, newtd=3D0xfffff80003ae7000, flags=3D<optimized out>) at sys/kern/sched_ule.c:2112 #1 0xffffffff80513d6f in mi_switch (flags=3D260, newtd=3D0x0) at sys/kern/kern_synch.c:439 #2 0xffffffff8055e04d in sleepq_switch (wchan=3D0xffffffff819aae98 <spa_namespace_lock>, pri=3D0) at sys/kern/subr_sleepqueue.c:613 #3 0xffffffff8055def3 in sleepq_wait (wchan=3D0xffffffff819aae98 <spa_namespace_lock>, pri=3D0) at sys/kern/subr_sleepqueue.c:692 #4 0xffffffff80511af6 in _sx_xlock_hard (sx=3D0xffffffff819aae98 <spa_namespace_lock>, x=3D<optimized out>, opts=3D<optimized out>, file=3D<= optimized out>, line=3D<optimized out>) at sys/kern/kern_sx.c:857 #5 0xffffffff805115e1 in _sx_xlock (sx=3D0xffffffff819aae98 <spa_namespace_lock>, opts=3D0, file=3D0xffffffff818ffa89 "fs/zfs/dsl_datas= et.c", line=3D3086) at sys/kern/kern_sx.c:328 #6 0xffffffff81815cc4 in dsl_dataset_promote_sync (arg=3D0xfffffe02597833d= 0, tx=3D0xfffff80c74143000) at fs/zfs/dsl_dataset.c:3086 #7 0xffffffff8181f2d9 in dsl_sync_task_sync (dst=3D0xfffffe0259783308, tx=3D0xfffff80c74143000) at fs/zfs/dsl_synctask.c:234 #8 0xffffffff8181d8db in dsl_pool_sync (dp=3D0xfffff80e53a8e800, txg=3D<op= timized out>) at fs/zfs/dsl_pool.c:819 #9 0xffffffff8184bfe3 in spa_sync (spa=3D<optimized out>, txg=3D<optimized= out>) at fs/zfs/spa.c:8124 #10 0xffffffff8185b206 in txg_sync_thread (arg=3D0xfffff80e53a8e800) at fs/zfs/txg.c:543 #11 0xffffffff804ca144 in fork_exit (callout=3D0xffffffff8185af20 <txg_sync_thread>, arg=3D0xfffff80e53a8e800, frame=3D0xfffffe039cc11ac0) at sys/kern/kern_fork.c:1057 #12 <signal handler called> Pending on lock: SX_LOCK: spa_namespace_lock, (struct sx *)0xffffffff819aae98 $5 =3D { lock_object =3D { lo_name =3D 0xffffffff8191dd6a, lo_flags =3D 0x22710000, lo_data =3D 0x0, lo_witness =3D 0x0 }, sx_lock =3D 0xfffff80003cdc584 } LOCK HOLDER: (struct thread *)0xfffff80003cdc580, tid 100163 geom :: (struct proc *)0xfffff80003d6ba50, pid 13 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking for the holder of the dp->dp_config_rwlock that the spa_namespace_l= ock lock holder is blocked on: >From the stack of Thread 1774: set $dp =3D (dsl_pool_t *)0xfffff80e53a8e800 p $dp->dp_config_rwlock.rr_writer $7 =3D (kthread_t *) 0xfffff807bb1af580 set $th =3D (struct thread *)0xfffff807bb1af580 p $th->td_tid $8 =3D 104418 The spa sync thread is holding $dp->dp_config_rwlock.rr_writer for write and it wants spa_namespace_lock while the cam "one_event" thread holds spa_namespace_lock and wants the $dp->dp_config_rwlock.rr_writer for read. --=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-RkiLN5TnD6>