From nobody Mon Feb 9 00:52:21 2026 X-Original-To: dev-commits-src-branches@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 4f8R461BZmz6S0rN for ; Mon, 09 Feb 2026 00:52:22 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f8R4603qdz3XNx for ; Mon, 09 Feb 2026 00:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770598342; 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=z82hu8LTj4muT81X2sTcDXq9mkuQ6UNrT99NuL8Y8Bs=; b=Z5deArpzwN/QcxjcGdVg+SPqK1xK5KM3sY4KuhOFs+T9gb/p+K5dpATtlwLwiWT1iHQhMD 8h7tJB0q8UTGhkfET8HfvfZv2NJRdsh+M/1/ODArtt+u0BFGecs9N1Uf8aj5AhsZ2BIaWX iRTaqZtlGQ2KicMQ/OQUkF8+i9koeMJyjsU689zVxZdX0rQyEhk0QxtguvuVAYfEqqO6xN FXgIqMuzfULoEU7NclQWRhXoPij1+offyn0ZftS+DEctJkK06O0RtRAwC7p/tAubhtlfat v5jo0zKfZD1uKSFiYwzjpk0k2Mj7NGDe8a9zCKDQO0TM7zhwqv5koLmuzrX1tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770598342; a=rsa-sha256; cv=none; b=Yo9+9TmUp8ut95aLWi5YGLM/z3RPsI3jDRJ5B/UI5B1UgzhthNWSjNJy2jNBjg+WDS1/sT uckxPNOzRxnywO6AIqRHP6Aal8bhsXNshdDSGUSIWF7kiXHn0nPPOeUNsUoCXjqZUG+Ohv QZFqG9UiqoYAktoEH1QA1sIEakBRImkREVhcCq08wCnAKdqKLu/t544foM1T86VMTM8mlR 7G4mRvH7GAZb5rQS6zy1B+iYWnNde+IPZhqzTLhWCxr1Xxp4x+h3To1mKMXRIKF03lCFvJ nkEAyHynxl4aqiNdkj14pwmJD/8Yy2Q1WbwkNC7FUrxx6MZxSLEBCHWC4PtHSA== 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=1770598342; 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=z82hu8LTj4muT81X2sTcDXq9mkuQ6UNrT99NuL8Y8Bs=; b=evHlroNLPtWDMPGLS/PB9XsHRekJY9BkuHMYGY/x4wcvRpX84o6hgMugOlcd5t7qJQa4JK I1AADAu8Dy0LlWnSj2yJ7eQols1mrmZrtzDEUcRTZSgtNSLRBeFRo2uhZQwJSd+FgLUw+0 uJ3Y+KlM86E75rqykFGxKAt6JW7nWbTvorGPA7pKZTHXWp27xCCdA7Kck39lqydBItkEgJ WsN23iIDKbHmD1QlwAZXxmPhD/2nB0D7he2bqoQcmozw03uwYKFGmIb84XLBQvYu37VxpZ eP+h6tMBJNldvyTbRuBYCGWZVhD4AQOcC5hFRwRL+hqFXAKD/CPqI+6KcoG5Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f8R456mr8z195H for ; Mon, 09 Feb 2026 00:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3226c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 09 Feb 2026 00:52:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fffd409a29ce - stable/15 - devfs: unlock the directory vnode around the call to dev_clone handler List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fffd409a29ce4966f2cca620aedc9f0eb1df9862 Auto-Submitted: auto-generated Date: Mon, 09 Feb 2026 00:52:21 +0000 Message-Id: <69892fc5.3226c.54b1ca4f@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fffd409a29ce4966f2cca620aedc9f0eb1df9862 commit fffd409a29ce4966f2cca620aedc9f0eb1df9862 Author: Konstantin Belousov AuthorDate: 2026-01-26 01:49:32 +0000 Commit: Konstantin Belousov CommitDate: 2026-02-09 00:51:57 +0000 devfs: unlock the directory vnode around the call to dev_clone handler (cherry picked from commit a8e92198f854c2766eedec5a2ea3cc23c64d7b12) --- sys/fs/devfs/devfs_vnops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 880756264b0f..8c188e768de8 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -367,6 +367,9 @@ devfs_populate_vp(struct vnode *vp) ASSERT_VOP_LOCKED(vp, "devfs_populate_vp"); + if (VN_IS_DOOMED(vp)) + return (ENOENT); + dmp = VFSTODEVFS(vp->v_mount); if (!devfs_populate_needed(dmp)) { sx_xlock(&dmp->dm_lock); @@ -1128,8 +1131,25 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlock) cdev = NULL; DEVFS_DMP_HOLD(dmp); sx_xunlock(&dmp->dm_lock); + dvplocked = VOP_ISLOCKED(dvp); + + /* + * Invoke the dev_clone handler. Unlock dvp around it + * to simplify the cloner operations. + * + * If dvp is reclaimed while we unlocked it, we return + * with ENOENT by some of the paths below. If cloner + * returned cdev, then devfs_populate_vp() notes the + * reclamation. Otherwise, note that either our devfs + * mount is being unmounted, then DEVFS_DMP_DROP() + * returns true, and we return ENOENT this way. Or, + * because de == NULL, the check for it after the loop + * returns ENOENT. + */ + VOP_UNLOCK(dvp); EVENTHANDLER_INVOKE(dev_clone, td->td_ucred, pname, strlen(pname), &cdev); + vn_lock(dvp, dvplocked | LK_RETRY); if (cdev == NULL) sx_xlock(&dmp->dm_lock);