From nobody Wed Jul 8 21:15:35 2026 X-Original-To: dev-commits-src-all@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 4gwW8s1CSnz6kt8K for ; Wed, 08 Jul 2026 21:15:41 +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 4gwW8s0SCWz3NTK for ; Wed, 08 Jul 2026 21:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783545341; 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=k7xelw3jFEz8iqafH03P2QxHnc7X9pfe3JLa/sX7CKI=; b=FWCPmTvwglA81o6jZCNSXEs/JwYLxYqsDsw6msdF+v0w2WyHuHaI9x+cbNt8b481Tpu0UK Kv636YDSYFz147YFzhnjQGN+hA3f7g5jCdIVZok1pSVZiGKJ2u+ReBFSneUg6CjSpFQqyD z8DoaKL3xvWnnQ0wf9yIrrmjOkEYxEJjbDXtBTTA+0sP3yW52eT9Eq4YDU0s2xjGys2Uuz gGeZ8y1A80BqoZiiMnr7pJ4PVBhab4aAHI7zdztR3BBcUaYEtWh1lBU65H5bgTTvM0UnSw a68VUGjxvb7PS0n10s0s9Zoqp9DwwwEPiExqp+avIVv38Y3CjEBVKzcCkpFu7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783545341; a=rsa-sha256; cv=none; b=m7c+19XjwYbPRWhmm2OTIJT/6n8RV0EkfA2Ox3vpo90gYktc1W37Z6ZUGldBa85lDDQrKY Wc991va1bosJ7UjJd3JNW+ocaBkrZP92BeoZylRfO053u8Y0S7v6sxrt5Ujzalzkpt1Sym Cw04gU50F9nNN6NGMwKWo1lD6G4qEvdywVsiAUZzvSeOyR0OMgWnhJ7/3URVPPLUoDQQ42 iDkJIQkgj2STbua6AuggdAG4Ef645k17vrMH6Brv5XGRHFhe64pUsvQg2u1kphUEdgseZY Hxt/1rPat9JZxYBTXWOaE/LL8eSQryzdUf0Y+ZnOUBIfC/N6wwiVJqWdGmVkMQ== 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=1783545341; 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=k7xelw3jFEz8iqafH03P2QxHnc7X9pfe3JLa/sX7CKI=; b=c75YyywoXmxzDolvstMAycDD72NilUD+7b3JaQgTYisPGGO7XRsygyHDk0Z9z5GU8X5ISh dbS9RwK0SlBYahaPpHb4sCywDy4KddwAtYuPlHxEg/7JDsUJvUEWqMw67LBOZzi5BFTMnd voqYEPnhuPAHgG51E0Whn7J5FfpRrzhnBtU+BJ0XQWsieL+yV0/FPQz66jT0FqkJMueEJd q/I95li2WoP9TTMZdv1sS1CtViv2xL5Lbs8aHXkNk8+y9V9BXe89s5OFIeUl8bUqEC5SFt xq6u+dmhDwwNy6ShcNWY96sjgPo03Zm3Xja2fBCq5wa8Qlk/mBaXpQU9cDFP5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gwW8r6MMpzg9D for ; Wed, 08 Jul 2026 21:15:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25467 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 08 Jul 2026 21:15:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 750d429a228f - main - vfs cache: further massage some commentary List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 750d429a228fb102d6e5d45bdc116489acbfff00 Auto-Submitted: auto-generated Date: Wed, 08 Jul 2026 21:15:35 +0000 Message-Id: <6a4ebdf7.25467.59f938de@gitrepo.freebsd.org> The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=750d429a228fb102d6e5d45bdc116489acbfff00 commit 750d429a228fb102d6e5d45bdc116489acbfff00 Author: Mateusz Guzik AuthorDate: 2026-07-08 21:13:34 +0000 Commit: Mateusz Guzik CommitDate: 2026-07-08 21:15:31 +0000 vfs cache: further massage some commentary --- sys/kern/vfs_cache.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 66210bf58a7c..9e1c9cb757b5 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -6349,7 +6349,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) * Note: all VOP_FPLOOKUP_VEXEC routines have a comment referencing this one. * * Filesystems can opt in by setting the MNTK_FPLOOKUP flag and meeting criteria - * outlined at the end. + * outlined at the end of this comment. * * Traversing from one vnode to another requires atomicity with regard to * permissions, mount points and of course their relative placement (if you are @@ -6370,6 +6370,13 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) * See places which issue vn_seqc_write_begin()/vn_seqc_write_end() for * operations affected. * + * Note: regardless of locked or unlocked operation atomicity of traversal only + * covers the immediate move from one vnode to the next. For example, suppose you + * are looking up "foo/level2/level3" and are racing against rename("foo", bar"). + * If the vnode for "level2" was found and locked prior to the rename call locking + * "foo", then by the time "level3" is locked the true path might happen to be + * "bar/level2/level3". + * * Suppose the variable "cnp" contains lookup metadata (the path etc.), then * locked lookup conceptually looks like this: * @@ -6378,16 +6385,16 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) * for (;;) { * // permission check * if (!canlookup(dvp, cnp)) - * abort(); + * fail(); * // look for the target name inside dvp * tvp = findnext(dvp, cnp); * vn_lock(tvp); * // tvp is still guaranteed to be inside of dvp because of the lock on dvp * vn_unlock(dvp); - * // dvp is unlocked. its state is now arbitrary, but that's fine as we + * // dvp is unlocked and its state is now arbitrary, but that's fine as we * // made the jump while everything relevant was correct, continue with tvp * // as the directory to look up names in - * tvp = dvp; + * dvp = tvp; * if (last) * break; * // if not last loop back and continue until done @@ -6395,7 +6402,8 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) * vget(tvp); * return (tvp); * - * Lockless lookup replaces locking with sequence counter checks: + * Lockless lookup replaces locking with sequence counter checks. If any of + * them fail, it falls back to locked traversal. * * vfs_smr_enter(); * dvp_seqc = seqc_read_any(dvp);