From nobody Fri Oct 04 15:57:09 2024 X-Original-To: dev-commits-src-main@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 4XKtTf296Cz5Xy00; Fri, 04 Oct 2024 15:57:10 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XKtTf0nYQz41BJ; Fri, 4 Oct 2024 15:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728057430; 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=w5lvDTxf0I3Amz6mn62d9VZ+QEeyZMt9tA4DSBc+tZ0=; b=LS6ZjXn8pWoNgHss/xy5+bvuUJl6kaCFBgokb5YJ1UQ9SRYvj4K+GroJlVKoJwRhC1Vc+q /iDf6veWnvHzivJ8fmQHT/W43z7wux4mmWKo7SR42aQb3JI/zAN9NtOO1nkbXXe0KVOb18 hxD/uGxxtMP2xZBNW4+1jsMsogqGkVXdsfYaoaBTu3q2sZ5PfYQdz1p9ZlSIk4ebws48A6 hDr0uwLGci84iy2iAipLC6PJpZEa116r3iFu2lzaahnt48fmH5SrWVtE0a8teO9w4cBT8r gXgeSFzaS1Rj4uW0MRTq1fU+hQ+gMKBTkpAFgr6i0y8fVoGR1D50PeoLL66e3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728057430; 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=w5lvDTxf0I3Amz6mn62d9VZ+QEeyZMt9tA4DSBc+tZ0=; b=u5jaQsgUObqqDNnjKIuIKTLRjCmyNs69SrvOR7OEbdWZqFow/mSFa7KTfopPgHX55qw61G ohy5WBiQqqN0e1jH9jCEbflm7+0zRyofumxRWSy7UTAYC7jsx6mHmoj8wO9hPBR6b3WfaX 4ZxAQ0vB6m1v/b33A2OTlzj27nbbyzLJpeGRHE/4JoWS/CRztiSLWf3NMXLezS5HEFpDQA cO8sgTX31oXyF4+rCrR8+3sjBy7E0PeeFAiN4GGCwBOWWz/3x14uevHNUq1abmr2SIOER2 moU6urnt04b5o4rSmuNO+ZCX76Kw98PNi8q+5fOeDxP7ajtCtTk8C1XVcS3Ngw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728057430; a=rsa-sha256; cv=none; b=uTeffqFHHK+Agfu8UopvEmzGXxw5zxCFAo4NcUH4qGVrvJq392McSZ1ukkbvHX32ElJHp/ woN2kpzWCnPkccW6wAP0AYMj0YtnJlE98myleCSVkUDCWcYV2fTX4zVsxQyYq/WfcLxoOg U0/ayTOo+pPb+CKuTBf3Kx/PxWmqNrj5s1K+1Vq081vLWhodiNlqEvD/Wb/qGNCz5vVANH GLInrHxqMj+J4Jw273hapHicfujTqz7N/m6RBooWdFbR4wDpeTTAStQ1XRcVB92zpiNG1e G471rq/W1zYE3w3iXMVk/B3xCihbDQnje8Gn/0atHHtwcQ6pdpeHYECsj89jxw== 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 4XKtTd6mw2zhJG; Fri, 4 Oct 2024 15:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 494Fv9Bf048777; Fri, 4 Oct 2024 15:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 494Fv95M048774; Fri, 4 Oct 2024 15:57:09 GMT (envelope-from git) Date: Fri, 4 Oct 2024 15:57:09 GMT Message-Id: <202410041557.494Fv95M048774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b37b2543a23b - main - ggate: Avoid dropping the GEOM topology lock in dumpconf List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b37b2543a23b44c78f6d78823dcfcedba46570db Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b37b2543a23b44c78f6d78823dcfcedba46570db commit b37b2543a23b44c78f6d78823dcfcedba46570db Author: Mark Johnston AuthorDate: 2024-10-04 14:53:57 +0000 Commit: Mark Johnston CommitDate: 2024-10-04 15:56:34 +0000 ggate: Avoid dropping the GEOM topology lock in dumpconf In general it's not safe to drop the topology lock in these routines, as GEOM assumes that the mesh will be consistent during traversal. However, there's no reason we can't hold the topology lock across calls to g_gate_release(). (Note that g_gate_hold() can be called with the topology lock held.) PR: 238814 MFC after: 2 weeks --- sys/geom/gate/g_gate.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c index 85c21406eda0..ecdcacff6707 100644 --- a/sys/geom/gate/g_gate.c +++ b/sys/geom/gate/g_gate.c @@ -329,7 +329,6 @@ static void g_gate_release(struct g_gate_softc *sc) { - g_topology_assert_not(); mtx_lock(&g_gate_units_lock); sc->sc_ref--; KASSERT(sc->sc_ref >= 0, ("Negative sc_ref for %s.", sc->sc_name)); @@ -453,9 +452,7 @@ g_gate_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, sc->sc_queue_size); sbuf_printf(sb, "%s%u\n", indent, sc->sc_ref); sbuf_printf(sb, "%s%d\n", indent, sc->sc_unit); - g_topology_unlock(); g_gate_release(sc); - g_topology_lock(); } static int