From nobody Fri Feb 11 13:58:08 2022 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 492AD19B0A24; Fri, 11 Feb 2022 13:58:09 +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 4JwFZ85FTlz3sk3; Fri, 11 Feb 2022 13:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644587889; 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=UjrI2tMfWMzhjfyAGcRIN6qTE5galcT7VKV/wdu+CUY=; b=HSkyzduWjf7itxw3pH4RD/pH+dqC0bQt18tEoLHFx7/UtpFVbwSDT97BpZalMxWJjxb/cc 4PXXhoWGyx7qGIquM7RnQKqYiP+0e5TjQaKAwppvtBgh68zBiFJ6cNiYZLmNlt9ApKrrqv PuXEqA/mJyH9lbnyi1LnARKwmbHocNkYSGmWS4y7mCZuTwJSQdk4zQZI2tPtJeDxBJBzxM wt+wlJveHvdStnJitMp70wxaIiF+Alv//ta1UoQipuxN2Qk0QJ1XPU+fbgY3N4UBNkdaPc l5FvEPRc21g+qqcW8VtEZblgLowK15ZV9aTKnpVFOzDI+DaYabJl2LXqfj9nyA== 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 7268D154C8; Fri, 11 Feb 2022 13:58:08 +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 21BDw8On093233; Fri, 11 Feb 2022 13:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21BDw81j093232; Fri, 11 Feb 2022 13:58:08 GMT (envelope-from git) Date: Fri, 11 Feb 2022 13:58:08 GMT Message-Id: <202202111358.21BDw81j093232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 1d65a9b47eab - main - cache: improve vnode vs name assertion in cache_enter_time 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 1d65a9b47eab75f12fcb5cc7547a69441ef764a3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644587889; 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=UjrI2tMfWMzhjfyAGcRIN6qTE5galcT7VKV/wdu+CUY=; b=chspys/G0PHJWx9XMF9SFPfwoqUlsJnj8+JCMp44EbaUR2ObAkgbHulCiDjWM7eP49FAyo 0tksz5yMtwr60gVhH4wwZZrDkAbyXfWl9Md0So241Oath8Tbd6bmhb+gxCrIAOFLzIjloT 67kuzM61pRnsZaMB8eUDjBoWGC/rmcVhNnUJ0KaE2137Nh0PgW9e24+55bWzNWXY4Rj3e5 wHZCwJIGT0NxZEgsq1COyBv+kkQcpDQX7gc67+NCwV5fWYyUz2AsgA5TMqNBWyKfbY7h9r Nz1z/OeqlC4POmQBVrZPsRV+3QsoP8guzozyethepralYJEvWe1KeXyyaD7J+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644587889; a=rsa-sha256; cv=none; b=ZGkWczTu8pXxKkwOxYYQ0Z+ZF67lzYV79t45Ln6hBgZ1QyYUrEYaYUqJpesAejLE8rXxtN pzruhTIOYeSFSUlWYicd7CWOFfbJ1jjzFtBGaz3ESJLggZCjz+IMLkVTLZyEglm8+QuXDD UrneDlByiTOsTjPFSeMX2snSZoeTct9BqA8dR7zOY5K2xhFkfHEbXyfPeFMcn/0E3vtT1i 3jKW7cK26C8zvHEnGDO9ToPV+tz7IkfHGWJdjhh2suA7+mENws5C193L4qUMlfG8a4RdOm Fk8QOU//O82HQef20nz3ehmyXWze+NEVukvTQ3JNgNaGIYoiIgmEFF2ylq6Qvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1d65a9b47eab75f12fcb5cc7547a69441ef764a3 commit 1d65a9b47eab75f12fcb5cc7547a69441ef764a3 Author: Mateusz Guzik AuthorDate: 2022-02-09 20:41:24 +0000 Commit: Mateusz Guzik CommitDate: 2022-02-11 12:29:26 +0000 cache: improve vnode vs name assertion in cache_enter_time --- 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 e4766194187f..c47f6a0438b1 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))