From nobody Sun Jun 21 10:15:55 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 4gjnKS19TJz6jRG7 for ; Sun, 21 Jun 2026 10:15:56 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjnKS0X9gz3HkN for ; Sun, 21 Jun 2026 10:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782036956; 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=5wAWSOMHhgYhnWGeHIyawCqautPpoYQZYCiHvNxafNs=; b=e6RbS0BqucyrjsVyZWxngE6czNfvlp+n6o8wkUHsNUkZ6gGuaYftR5gZbLWUT0/Vt/eYl6 KZRagnLRXho301J5Gx28KZqlMR7nwbYJX0lo6j3AbrMMu8E/GLCWb952Ck6NDm2AH1ZbH3 L/Q02fkuGp+eOLZQLXCKN2M1K05wExm1r0/cclYljPyIDkWN2q/Wb398He1kyg14Entzfg dS1XTMitdbQZNOG4TyVIlmQiVLz53V9PkYTXPM9i+jzOrOjy+vzMxigKUoEzwuLJZ65xv4 705Rw4gZV5yI18NE06EuA/TY8Qy9Y7G/TNbgRLDOjIZySUGQ9KVmVF457eKBnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782036956; a=rsa-sha256; cv=none; b=AG/eaQYHT5aAQj8Wzw5uZJJHVCyh8MbkEN828zrzQQf4v2RbEAbNAmgGj9yAxamxNeCNZA mFThHNRAOkH+bi5xxr6mtxjGJhWYADjXAnGzG79V1pYmPm3yVA2iUSPsSvOsq3AP5/Rf14 yheJK+sd5lv1UrB58Cgw21pJNClPz5dgNPE8Z3bth1BOJuo506u33BQtOdPp08cUxQdxwE r8wSBTxn5CksGmPHZC2wG5mV2qa0YfpjcVLH1UvwBMkY8DAd92rFSNTj56gqkJ4a+KSK44 Yrv1o4AcHMSWwRvSPPBUdCQ3QpHanXmcnQ77KrXe6RCetihsw0sldVX89PWUbg== 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=1782036956; 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=5wAWSOMHhgYhnWGeHIyawCqautPpoYQZYCiHvNxafNs=; b=FQso2YhaIekoN/MyJAA3gphZf4qhkviKALTa6MU6r2ZPiDp/faC0X0774kjIsxlNfbdZHZ F/sx0Y/5tEdp9C/7k8NjcndcJ0P1Bk53YzLoWifNa4XknAgbSFNuJWosIn5Q5cVCGnHLCu jXJ/qG8T9rUfARSIR+X8WIGaV2gts3lPaR1mGGkCdYrHhmMonbCjBU68FtHYN6OKxJ34Qj zby5ClkDSF7i/gE6/eEnx3BLjsHPqNh1rjYrxllGrSFi4YltzjrzZcItCK2e/0RIlJ387d 3D8PbWcKSqYSQN+/2jzMED7Ju7THtPI5gRu9SpTtYxN7VSGxHHSxFZuRazKTHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjnKR5R8Vz1Bl4 for ; Sun, 21 Jun 2026 10:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d2b4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 10:15:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ef9f11abea38 - stable/15 - vfs: work around the race between vget() and vnlru 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: ef9f11abea383fd55d027a270532bc030f90d805 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 10:15:55 +0000 Message-Id: <6a37b9db.1d2b4.1a601134@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ef9f11abea383fd55d027a270532bc030f90d805 commit ef9f11abea383fd55d027a270532bc030f90d805 Author: Konstantin Belousov AuthorDate: 2026-05-28 09:42:38 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 10:05:27 +0000 vfs: work around the race between vget() and vnlru PR: 281749 (cherry picked from commit 36b155a2b3baa747c1968a9094df9fa7fb0d02b3) --- sys/kern/vfs_subr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5248f7fad25f..d2894858fc94 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1931,9 +1931,14 @@ vtryrecycle(struct vnode *vp, bool isvnlru) * anyone picked up this vnode from another list. If not, we will * mark it with DOOMED via vgonel() so that anyone who does find it * will skip over it. + * + * We cannot check only for v_usecount > 0 there, since + * v_usecount increment is lockless. Instead check for + * v_holdcnt > 1, with the side effect that a parallel vhold() + * also aborts freeing this vnode. */ VI_LOCK(vp); - if (vp->v_usecount) { + if (vp->v_holdcnt > 1) { VOP_UNLOCK(vp); vdropl_recycle(vp); vn_finished_write(vnmp);