From nobody Wed Jan 26 18:38:29 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 553AA196CCC5; Wed, 26 Jan 2022 18:38:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JkXY21w26z3mnL; Wed, 26 Jan 2022 18:38:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643222310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pnh5FKrb/Te7mZSEy/c/JLSwXvxQSj1g7kq1kyGpb0A=; b=y4aaiDUuW/sM4i0QC4ZA7f6DC9LEnzAh8K8M+GT8BAFZGk7fT+Ie6Umwg8ux89Pmgv+wGa bvat8+yh/Wm4Rmfel/rstl+uEH13KdyZNOgNPTT4Bo9Iewjnon3+LWUv61r6XAQg8zVnX3 mSeyMYDYDL/rEdWF0d/IGDTmrHVzZu4V+Ai6nqdkL3FQQYdwhDS+nl38EH30oPjMpgpeX+ IVv3QoYcTdEIX4D9G//AgPansBAvTCwYV6W+3fxPPm04mfgI8WM9vMiAmDrC5ESsDon4jl Gza6FeqrUGh2sNJpZzVxYpcVaVq4WA3m0KK/g2lOmhw4kfrILWQjF3sMeTjS8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DB3627B72; Wed, 26 Jan 2022 18:38:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20QIcTIr045537; Wed, 26 Jan 2022 18:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20QIcTlI045536; Wed, 26 Jan 2022 18:38:29 GMT (envelope-from git) Date: Wed, 26 Jan 2022 18:38:29 GMT Message-Id: <202201261838.20QIcTlI045536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 47e46b1123b9 - main - zfs: Fix zvol_cdev_open locking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47e46b1123b9c732c366848e8184ce42e086a0fb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643222310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pnh5FKrb/Te7mZSEy/c/JLSwXvxQSj1g7kq1kyGpb0A=; b=Lq+HikyDBCbxHPaGnstIWPQfQuXZ4OEKxi0K8qYx7FwG76kZ4Chfw9ie9WSxkTXfcC7Hqt QjyI/3owx0Zbqwtskrrk0+zEPh5Zox2jMAbHcKu/XC+TOUxpk58B5XMVGq60wJ9qT9xPGG z5TyqU88OQ/C11TV+oXFg1VV8MG2Jq2XJd09GqIstUkA0j4fpHuxyTrhxGsjOg5phNMML3 64DOFY61Nqprs82nGlajpNEBAwxJqkAAV5H+h6xR/x3r94BggkoD/W77NwLx8ZwNOhvlDu VWMPS8IvZKpy9vgdSA9fJVYZK05T4mE3pxxnMkzq63VDW6ABH53spH0DEKrIzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643222310; a=rsa-sha256; cv=none; b=PSPmjums1LaJYALTUG0cnLYpNk+DkGZD5fneCNksRmAB/oDwGh0DkLb3JCOGq2/187wPlE oOg1oq5vNOFFmvmwT6pDfML2tjm1Ldq4KWKaqDRixrt2nzresbssjmbafru4P4B/x7pKqx 1+GHJik97QEDIZpB179KMz+IASV5ak+La/jTG15gPUjUj6xzhnLd3bIgYUNoDVFyYsR43V JWRR+Mji8zFHluJFMdKoKOM5TXXyPcDRJljepH79eqAenPyVqNryux8rnswMQtaC+rzpGI /p+BIxngbFgYBkET+YwFnjcyMhNCP5w0sbxaJZ5oOUozTswx7wUlhUwHbpNizg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=47e46b1123b9c732c366848e8184ce42e086a0fb commit 47e46b1123b9c732c366848e8184ce42e086a0fb Author: Ryan Moeller AuthorDate: 2022-01-26 18:33:23 +0000 Commit: Ryan Moeller CommitDate: 2022-01-26 18:37:52 +0000 zfs: Fix zvol_cdev_open locking First open locking changes were correctly applied to zvol_geom_open but incorrectly applied to zvol_cdev_open, causing spa_namespace_lock to be held indefinitely. Make the first open locking in zvol_cdev_open match zvol_geom_open. This change has been accepted upstream in openzfs/zfs#13016 but is not yet merged. Reviewed by: mav Fixes: e92ffd9b6268 Sponsored by: iXsystems, Inc. --- sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c index 8785557cb61d..06dd8cfdd790 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c @@ -928,8 +928,8 @@ retry: */ if (!mutex_owned(&spa_namespace_lock)) { if (!mutex_tryenter(&spa_namespace_lock)) { - rw_exit(&zvol_state_lock); - mutex_enter(&spa_namespace_lock); + mutex_exit(&zv->zv_state_lock); + rw_exit(&zv->zv_suspend_lock); kern_yield(PRI_USER); goto retry; } else {