From owner-freebsd-fs@freebsd.org Wed Dec 12 18:21:57 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E951317E3C for ; Wed, 12 Dec 2018 18:21:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D8EFE71411 for ; Wed, 12 Dec 2018 18:21:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 9AFED1317E3B; Wed, 12 Dec 2018 18:21:56 +0000 (UTC) Delivered-To: fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 786C31317E3A for ; Wed, 12 Dec 2018 18:21:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1721C7140E for ; Wed, 12 Dec 2018 18:21:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 5E7B68A6C for ; Wed, 12 Dec 2018 18:21:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id wBCILtjg065097 for ; Wed, 12 Dec 2018 18:21:55 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id wBCILtl9065096 for fs@FreeBSD.org; Wed, 12 Dec 2018 18:21:55 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 229958] ctld / zfs deadlock with 'zfs rename ...' Date: Wed, 12 Dec 2018 18:21:54 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: daveb@spectralogic.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2018 18:21:57 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229958 --- Comment #8 from Dave Baukus --- (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) 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) 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, tag=3D0xffffffff8190d1da) at fs/zfs/dsl_pool.c:1338 #7 dsl_pool_hold (name=3D, 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, propname=3D0xffffffff8192fda6 "readonly", intsz=3D8, numints=3D1, buf=3D, setpoint=3D0x0) at fs/zfs/dsl_prop.c:320 #10 dsl_prop_get_integer (ddname=3D, 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, count=3D, flag=3D) at fs/zfs/zvol.c:1198 #13 zvol_geom_access (pp=3D0xfffff8062add8c00, acr=3D, acw= =3D0, ace=3D) at fs/zfs/zvol.c:2737 #14 0xffffffff804809f9 in g_access (cp=3D0xfffff804ef224000, dcr=3D, dcw=3D0, dce=3D0) at sys/geom/geom_subr.c:977 #15 0xffffffff80486974 in g_part_taste (mp=3D0xffffffff80a7ebf0 , pp=3D0xfffff8062add8c00, flags=3D) at sys/geom/part/g_part.c= :1982 #16 0xffffffff8048158a in g_new_provider_event (arg=3D0xfffff8062add8c00, flag=3D) 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 , arg=3D0x0, frame=3D0xfffffe010e5a9ac0) at sys/kern/kern_fork.c:1057 #20 =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) 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 , pri=3D0) at sys/kern/subr_sleepqueue.c:613 #3 0xffffffff8055def3 in sleepq_wait (wchan=3D0xffffffff819aae98 , pri=3D0) at sys/kern/subr_sleepqueue.c:692 #4 0xffffffff80511af6 in _sx_xlock_hard (sx=3D0xffffffff819aae98 , x=3D, opts=3D, file=3D<= optimized out>, line=3D) at sys/kern/kern_sx.c:857 #5 0xffffffff805115e1 in _sx_xlock (sx=3D0xffffffff819aae98 , 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) at fs/zfs/dsl_pool.c:819 #9 0xffffffff8184bfe3 in spa_sync (spa=3D, txg=3D) 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 , arg=3D0xfffff80e53a8e800, frame=3D0xfffffe039cc11ac0) at sys/kern/kern_fork.c:1057 #12 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.=