From nobody Mon Sep 21 05:10:29 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 4hpBBf3x54z6tFys for ; Mon, 21 Sep 2026 05:10:34 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hpBBf1rqdz4S3t for ; Mon, 21 Sep 2026 05:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789967434; 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=xo8ypBE2hj0bzQUlH9zzMT6JdK5JwfNPf3k9y2XmDBk=; b=c4m2tmkJOlSfQcoipedq4KtamsYG69lzRWie+EJjhODPMIHP44cOoc4dQavfmGckIrGMPD u/hikI0kHeccT8NMgHm5j0xFoiUpjjckgzmQ8DbMhY295k2fKN4S6Q+SgEeAAmeXllITy7 h5jobIKj4PR2IlEVCf46zkmM4s1+YgSj5ozLm3N2FbowJ1sHvi54PF55JRgcAGXVFWN+DN hIsr/5OXS1+lJ8LS+U7u+LVUpNfke89WZyDKI/NPZYqKE7k5m8rGVqCjA99KQyRm4LxbDc 2Jwos6GY9H9hNLBdd+bDW36DcDBsSs8x560QB0oJo0w2EnVoh84yrMHx3LuAYg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789967434; b=FPFHrHQacEbkDz/TYj2Yn64A6KnwCHoHvDv4f7y1z6nKnijRB4xRXiR9b+nAe5Br/KRQwZ Hf98+JGf0tGmt5CBXUOAv1bfmsijPa4uu9ZKRkfsA2OkSh+WNzS7sdFxyR2sh2TYY/odKa QHJ73I+CVWMIskpO4efWHDz5JJjMtvc0NtZ5SXKQv9K4XwnzbrUo6zh6B5wRfpWwTlA9uC p+m4XKFz1Ij+aTLR0CUnnFu9KWcTgF/7p9npfqDldJbI4DlhpUcQ4AlfDxabRXnQKG5ZRo C9/oRcmag3R8JVWTYwqvWC72KvhYJEF8Aiuqv3NJ1cNRpapU+ktC25oXd3j+7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789967434; 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=xo8ypBE2hj0bzQUlH9zzMT6JdK5JwfNPf3k9y2XmDBk=; b=lq+ukJJkCRPjr8VyJuutGsb4tCkAhS7uOihDrI/QNa3ZUCepMKj9hyjPOdb+qQyNf02WQi Tf/pMy9Hwz/PTw7uDLY3fquppPoR9wtcQX5vuy7ChLaTLJIW1TaIC1GbCD3UXUhKXozxz/ LyX8WMjAFWeKlK+MQnacFT2L66zRfYhfE3RddFBAPwgOze5ynwz3fyO6ViN/eX9Sd8J2ky JtCuB/Iu0pOhbqjFaUHKAMcKeYeuwqu9ZzSJCE/jYT5sP+O9/Mw8sXJCPQJDiRylbqEoBv 1yZvMhZieVsE+ZpU64UlTc0eso+0ps7gRKwQJMz93fBDb4n0bISm9wrehLKQ6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hpBBf0fRWz15Mp for ; Mon, 21 Sep 2026 05:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38117 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 21 Sep 2026 05:10:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jason A. Harmening Subject: git: 23152cae2f7d - stable/15 - vfs_lookup_cross_mount(): fix missing LK_CANRECURSE 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: jah X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 23152cae2f7df9a4291aa2cc8705600bbd78c57e Auto-Submitted: auto-generated Date: Mon, 21 Sep 2026 05:10:29 +0000 Message-Id: <6ab0bc45.38117.60202b54@gitrepo.freebsd.org> The branch stable/15 has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=23152cae2f7df9a4291aa2cc8705600bbd78c57e commit 23152cae2f7df9a4291aa2cc8705600bbd78c57e Author: Jason A. Harmening AuthorDate: 2026-09-07 17:36:20 +0000 Commit: Jason A. Harmening CommitDate: 2026-09-21 05:09:22 +0000 vfs_lookup_cross_mount(): fix missing LK_CANRECURSE This was a rather dumb miss on my part in commit 42442d7a6e. LK_CANRECURSE is clearly needed in any case in which the covered vnode is held exclusive across the call to VFS_ROOT(), regardless of whether it was initially held exclusive or upgraded. The commit message for that change also noted that unionfs lookup only worked without LK_CANRECURSE due to a coincidence of the then-current unionfs implementation. As it happens, said coincidence was recently removed in commit b952606b4f ("unionfs_lock(): eliminate LK_CANRECURSE special- case"). PR: 298201 Reported by: olivier Fixes: 42442d7a6e "Generalize the VV_CROSSLOCK logic in vfs_lookup" Reviewed by: kib, markj, pho Tested by: pho Differential Revision: https://reviews.freebsd.org/D59494 (cherry picked from commit f57ce26f2572efb8adc825ad4efc0e0743a9112f) --- sys/kern/vfs_lookup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 0550a4fc0d4d..6f06fc8268fc 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -979,16 +979,20 @@ vfs_lookup_cross_mount(struct nameidata *ndp) * We are going to be holding the vnode lock, which * in this case is shared by the root vnode of the * filesystem mounted at mp, across the call to - * VFS_ROOT(). Make the situation clear to the + * VFS_ROOT(). Make the situation clear to that * filesystem by passing LK_CANRECURSE if the - * lock is held exclusive, or by clearinng - * LK_NODDLKTREAT to allow recursion on the shared - * lock in the presence of an exclusive waiter. + * lock is held exclusive, upgrading the lock (and + * passing LK_CANRECURSE) if the lock is held shared + * but mp requires an exclusive lock for lookup, + * or clearing LK_NODDLKTREAT to allow recursion on + * the shared lock in the presence of an exclusive + * waiter. */ if (VOP_ISLOCKED(dp) == LK_EXCLUSIVE) { crosslkflags &= ~LK_SHARED; crosslkflags |= LK_EXCLUSIVE | LK_CANRECURSE; } else if ((crosslkflags & LK_EXCLUSIVE) != 0) { + crosslkflags |= LK_CANRECURSE; error = vn_lock(dp, LK_UPGRADE); if (error != 0) { MPASS(error == ENOENT);