From owner-freebsd-fs@freebsd.org Fri Jan 11 19:43:19 2019 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 341C7149ABAA for ; Fri, 11 Jan 2019 19:43:19 +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 AED70834B5 for ; Fri, 11 Jan 2019 19:43:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 7099B149ABA8; Fri, 11 Jan 2019 19:43:18 +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 4D67D149ABA6 for ; Fri, 11 Jan 2019 19:43:18 +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 C15A7834B1 for ; Fri, 11 Jan 2019 19:43:17 +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 114DCEE20 for ; Fri, 11 Jan 2019 19:43:17 +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 x0BJhGHC064133 for ; Fri, 11 Jan 2019 19:43:16 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x0BJhGmc064132 for fs@FreeBSD.org; Fri, 11 Jan 2019 19:43:16 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: Fri, 11 Jan 2019 19:43:15 +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: Fri, 11 Jan 2019 19:43:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229958 --- Comment #10 from Dave Baukus --- 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) 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, priority=3D= 0, wmesg=3D0xffffffff809042a5 "gtopol", sbt=3D, pr=3D0, flags= =3D256) at sys/kern/kern_synch.c:217 #5 g_access (cp=3D0xfffff805da3f3a80, dcr=3D, dcw=3D0, dce= =3D1) at sys/geom/geom_subr.c:932 #6 vdev_geom_attach (pp=3D0xfffff801ffe33800, vd=3D0x0, sanity=3D) 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) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:722 #9 vdev_geom_open_by_guids (vd=3D) 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) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:3765 #22 spa_load (spa=3D0xfffffe013f864000, state=3D, type=3DSPA_IMPORT_EXISTING) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:2348 #23 spa_tryimport (tryconfig=3D) 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) at sys/kern/sched_ule.c:2112 2112 cpuid =3D PCPU_GET(cpuid); STACK: #0 sched_switch (td=3D0xfffff80003d23000, newtd=3D0xfffff80003ad0000, flags=3D) 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 , pri=3D0= ) at sys/kern/subr_sleepqueue.c:613 #3 sleepq_wait (wchan=3D0xffffffff81cb39a8 , pri=3D0) = at sys/kern/subr_sleepqueue.c:692 #4 _sx_xlock_hard (sx=3D0xffffffff81cb39a8 , x=3D, opts=3D, file=3D, line=3D) at sys/kern/kern_sx.c:857 #5 _sx_xlock (sx=3D0xffffffff81cb39a8 , 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, count=3D) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c:1276 #7 zvol_geom_access (pp=3D0xfffff801ffe33800, acr=3D, acw=3D, ace=3D0) at sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c:2739 #8 g_access (cp=3D0xfffff8052a7a3c00, dcr=3D, dcw=3D0, dce= =3D0) at sys/geom/geom_subr.c:977 #9 g_label_taste (mp=3D0xffffffff80a7dfe0 , pp=3D0xfffff801ffe33800, flags=3D) at sys/geom/label/g_label= .c:392 #10 g_new_provider_event (arg=3D0xfffff801ffe33800, flag=3D)= 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 , arg=3D0x0, frame=3D0xfffffe010e5a0ac0) at sys/kern/kern_fork.c:1057 #14 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.=