From nobody Thu Apr 9 01:10:33 2026 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 4frhgs3nTHz6Y7N0 for ; Thu, 09 Apr 2026 01:10:33 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4frhgs2cChz3Hl6 for ; Thu, 09 Apr 2026 01:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775697033; 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=9ylJOsv+k8j1SdCbCOqVlWnsK0wYYXCM53TtFtEZe7s=; b=r9VxEIjlKAhg7/xIEnlJV3MVQ1SBeYgu/1c4BX0pkdW34wTxyrxBfDA9F0Bfj4l4keaQEM aW8FcKB2aUt4YuwUbXQ4WCe5lwsSMUjjqq+6QcqRP/HqwWM4UysIN4u2eTyg7hrCxTSuYY FMShzijLwhYIBzKrLNSS4NHkyLpIAo8NyUk6QCjIqJ4xx24SKQoL4a4pGeyu0jXKb6cB7R 2IypsaBO+Wd1YjV+u75dT3rKV28mARnE/LXeoOk97zJtUWDxrKfJX5Wis0GtB67FPWjEIt bHYXisuQsZEQZEivg8WPQKz2o2akGaCugPcKk3sS9ASmgULpz48MtDBglZezjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775697033; a=rsa-sha256; cv=none; b=l9DLa3dUfptsc9CXPolVVy/FnLs8g9okfJm6qriXb8kLQ/TV2DCsAGdW4ZSDfXEsuXmLhC +oBs9QBZQMGQjICHwjNaWYKCA1iF9dpqTDsM/hyJAH6pbaTjfPFnJcHGHZkVbRU8uG/3rN pEJM1u5uBgEAQNq4w7miSbwT5jBYmWPFxMCL07mG8T6oqR1b6JRvGCCdn3PmIlId5uVQCp gD+C/T8vje7qj2WOhRd9NFziP66Fl16K+hJSAzzh+xLL4u6cBfSyJ8arMRUcsoleSRSVwl lr0j2SzAPlXMBeV05KZlLNaugIRA9joC+7chnp3vBuICTeQP4Bd+61/U6Biddg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775697033; 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=9ylJOsv+k8j1SdCbCOqVlWnsK0wYYXCM53TtFtEZe7s=; b=MyC59JOUXoB2BtSqx9gFbHPYhjby6+zMOuXgnPTSoS93An9N5Ms/KNqLG9Ww3UBCorvj0o pwoGPRvLuTtwLFO7Lo6WMhJvCL05mAOVb3Zy3cBpcGUjhbvFjMPDvuyFj3jKzP3qsvOF6V 3+8U/Isl/DWEa/yPJc1U4STmOC5x/QDItT0gmz3WwUtHnYKiIrhEBcyavvXIFKfLwnc5ur QjPPD4eolCsUaQI8u/ISw5TsKjEwi3bXm6Gj1l626PL9EyTT0VqTZsmKcFRFSFpX3wj/Sr 22DBjy26olftY76BzuiQq3Mo5jVMjOzzhqkrec/+J43O+7InccPQwt+P6oLm/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4frhgs2CQ1zrs3 for ; Thu, 09 Apr 2026 01:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39bd7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 09 Apr 2026 01:10:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 36d971464ac2 - main - geom: Make g_waitidle() wait for orphaned providers 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: 36d971464ac21f6531cb9eaa377f4e1dd915a2ad Auto-Submitted: auto-generated Date: Thu, 09 Apr 2026 01:10:33 +0000 Message-Id: <69d6fc89.39bd7.c1e5944@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=36d971464ac21f6531cb9eaa377f4e1dd915a2ad commit 36d971464ac21f6531cb9eaa377f4e1dd915a2ad Author: Mark Johnston AuthorDate: 2026-04-09 01:08:45 +0000 Commit: Mark Johnston CommitDate: 2026-04-09 01:10:13 +0000 geom: Make g_waitidle() wait for orphaned providers This is motivated by the following race in the ZFS zvol code. When a zvol is created, we create a GEOM-backed zvol, which results in a /dev/zvol/ device file, created by GEOM::dev. If volmode=dev is specified, zvol_set_volmode_impl() will wither the GEOM, then create a device file with the same name. This sometimes fails because g_wither_geom() is asynchronous, so we end up trying to create a device file while the old one still exists. I want to fix this by adding a g_waitidle() call to zvol_os_remove_minor(). g_waitidle() is not sufficient: GEOM::dev does not destroy the device until g_dev_orphan() is called. (In fact the device destruction is asynchronous too, but the delist_dev() call is sufficient to address this race.) So, I propose modifying g_waitidle() to block until orphaned providers are processed. PR: 258766 Reviewed by: mav, imp, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D55049 --- sys/geom/geom_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index ffd46db55416..34649cea5a71 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -84,7 +84,7 @@ g_waitidle(struct thread *td) mtx_lock(&g_eventlock); TSWAIT("GEOM events"); - while (!TAILQ_EMPTY(&g_events)) + while (!TAILQ_EMPTY(&g_events) || !TAILQ_EMPTY(&g_doorstep)) msleep(&g_pending_events, &g_eventlock, PPAUSE, "g_waitidle", 0); TSUNWAIT("GEOM events");