From nobody Sat Mar 05 19:56:55 2022 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 943BF19FF8C7; Sat, 5 Mar 2022 19:56:57 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K9wV00NMgz3tFf; Sat, 5 Mar 2022 19:56:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646510217; 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=yirbSUbz7fxwBMp6nt9ZCOy+hKplITImMpzVTitG9cE=; b=qDzIOPXLZxb974WWnaf7Ud2+yAwaOKjUVqECRaAEoJWjCoFDLXwClEiNri+q7yknniRbJ6 RnZwTrR+FnJ3m1ZXhxjgtA+EGWZPxdTiTU7Z9T9c2iEYey7xK8hhytgTXJqeI/3TIs7uwU alrzuMyNJe2aojSsV4eqAw3BBvNwNTB3utreB001ffqHpYWwJjIQWUHkd5/0WCH1+UFTZC o1Az7wKke4/r3IgJ1OnSiLfWZl1XUyp0sLUsMnmuVIvBQFh6h+d06dnLXPRVJLwc5el8Of b6KEJMz6c10KTTxk4JWjIDkmDYyMHcYyD97kOQUPmsDVRFiBk2wloKAUQrAE4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2E9E26760; Sat, 5 Mar 2022 19:56:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 225JutZs018236; Sat, 5 Mar 2022 19:56:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 225Jutxo018235; Sat, 5 Mar 2022 19:56:55 GMT (envelope-from git) Date: Sat, 5 Mar 2022 19:56:55 GMT Message-Id: <202203051956.225Jutxo018235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: d6132e2117b7 - stable/13 - cache: improve vnode vs name assertion in cache_enter_time 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d6132e2117b7f035a3d73b5cbb34d609aa58f212 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646510217; 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=yirbSUbz7fxwBMp6nt9ZCOy+hKplITImMpzVTitG9cE=; b=E0YWBRWKaTYITeA5O0tQ5dPSAPuUXJZ8kHBPLP23J2QcgETjFCJO7ie9zLe2W7oLGjG8gh XJ/timYxMtPvsmKK4vJswMtY2M/9etQ2xZnBT2/mye7I8c/UqPh/UfNKiDmryS4AZmNlaf 5PnjQZGVczYWx8dOD4W0wfEo42KQA7a0GoEiD+2so0wbLNVjUh7QK1d/+8JGLkDJpomAvS kfofvztrn4M7TfnHRR0uKS1FJ4UBsRb9POyru1eJGwhjSwCBXOg93/PTfIsxVhjLnPUNEM 48vboiNc3Zd5NOOvzcXT2fy3LCAB0wyRfhJFlL45ObXQ2/HPi7FUQVTQ35c0Fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646510217; a=rsa-sha256; cv=none; b=nBjmetRBhwYvKDiFIupkqH+RKyaqKBC+RVocWT0Iiv4BNCjSV3rtASoBIV2unDCtGsj4p3 TvxsCxD5P/0q3zeyIOlYUNaAj2fk5HX3CBlreshUcuX47vr2LkeLpzTc19d46LTtKSesqR OL5YJ/qJZVPP9adr4/Kyit+vgPt3daKB/7GOzmxtNmescCm+qUm328QliqUKTGaaFRUKrg iyHo0ssceC5NhfnOndgnCFUYTB6JihMcF0KssjJjnEm/JRr/yTyIfpaEhvoObI48d6iyo0 /6MmuOIIGzUVCVvuo/L5F/xAF09nMdT+rNGmxP5PH+XzsR4jBB5dtNVSjgO6vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d6132e2117b7f035a3d73b5cbb34d609aa58f212 commit d6132e2117b7f035a3d73b5cbb34d609aa58f212 Author: Mateusz Guzik AuthorDate: 2022-02-09 20:41:24 +0000 Commit: Mateusz Guzik CommitDate: 2022-03-05 19:53:46 +0000 cache: improve vnode vs name assertion in cache_enter_time (cherry picked from commit 1d65a9b47eab75f12fcb5cc7547a69441ef764a3) --- sys/kern/vfs_cache.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 780b5003749b..52ed0756db25 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2387,18 +2387,21 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, KASSERT(cnp->cn_namelen <= NAME_MAX, ("%s: passed len %ld exceeds NAME_MAX (%d)", __func__, cnp->cn_namelen, NAME_MAX)); -#ifdef notyet - /* - * Not everything doing this is weeded out yet. - */ - VNPASS(dvp != vp, dvp); -#endif VNPASS(!VN_IS_DOOMED(dvp), dvp); VNPASS(dvp->v_type != VNON, dvp); if (vp != NULL) { VNPASS(!VN_IS_DOOMED(vp), vp); VNPASS(vp->v_type != VNON, vp); } + if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + KASSERT(dvp == vp, + ("%s: different vnodes for dot entry (%p; %p)\n", __func__, + dvp, vp)); + } else { + KASSERT(dvp != vp, + ("%s: same vnode for non-dot entry [%s] (%p)\n", __func__, + cnp->cn_nameptr, dvp)); + } #ifdef DEBUG_CACHE if (__predict_false(!doingcache))