From nobody Wed Apr 24 19:43:44 2024 X-Original-To: dev-commits-src-main@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 4VPqDJ6Jshz5Hyjp; Wed, 24 Apr 2024 19:43:44 +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 4VPqDJ3vQCz4FHt; Wed, 24 Apr 2024 19:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713987824; 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=nvVY/3bEoPQVcpCL5lnzv2gjw+6ZtHsZo1dtfAiy2HY=; b=hGi23EFp3WlUVdu0IvDVAxpuAVRjDKWDKIge90JDFfGsK2gttaTMlGs1VRFGLSnGiGM3Us lNIbyRupHzcHpE4cjIwFbmXGKN/K96NPv2tYipJaPt1/tAt+EEUwEjPbsLqEcVWd9l5t0j qp/KPdIzVlPWgOV/yhW5JYHYB/W2vPOyJbgUaNizJ6k+D885S6LxFuq/OJ/LrDK5oB7057 oVuhfSoPrDxkx68rjVuk2kuOodA4E7LD1d9jQqFWSJF02KJdqpfd6P4FfbO3aFUqHzV0Rd VfYZW3RrQzpssehZoCDn//IN3HZBrTy9y/ZFlIBqoY3hYgVUEKK9pqWH9skoDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713987824; a=rsa-sha256; cv=none; b=fj3F1QLuBeOmy1Ie8wiNFTgcmeAppXUMER5/ACaUBxhdJa8v7SqIRL4BtMstdQPKP0daz0 Rj0mwyzaOmZYvc3IJVJZ+pPMKq9J151lckl9a3euaqZbr6UpZ89MSELe/vNdk/bIC9JKHB y4kgf0XOd819oU5KCmnZZOi7XtDzpT25U7WrDK8mbF/8x8YwxyOvIpF+9Zjp97pIpX5MGC iqiB8q1+TbfVcQ6bLNJtQCndIPaDS2Brkt9Jg1PjQlqlRVaU1XdGKwnrb228E/xPMwgikY HYnMl/GMP7sDzZcZD9W9CjOQtNfACQI5R3gTG8ujPiA+/Sz1PbR3k6FwegTzHg== 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=1713987824; 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=nvVY/3bEoPQVcpCL5lnzv2gjw+6ZtHsZo1dtfAiy2HY=; b=Ync5EW/+2g4Sac/eecqBaroV1LKb3K9fo8iRmrIJyWNZK1i6nu3vsFl0JMgcE9JnK4z8JU 9cG10qZfcqrOKTwk46VZnKL2heYJbDwRgC7Ods1P2o992xabq/wEjb2JI7gRSNk0Zkvcym 4pOQ6ZKabgS4l8HOg3lxhFaGmMQMW0ZzwoTjhYPycIbvS5e1ORz0+cYLrMqTAwk+pX5+5V M+owUdo2FTvrCyH+R/Kvjf7mDd+1nptIrNl0WDEUi/IdK536jCCwCrCRJpcyffpg2uJUnr k189GUyz1IDOFTdztVAgtMnFDu+E87RjTF6pP63e8iihUecXLlJYu1lTTQ4b3A== 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 4VPqDJ2brDzSgQ; Wed, 24 Apr 2024 19:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43OJhigt013991; Wed, 24 Apr 2024 19:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43OJhi1F013988; Wed, 24 Apr 2024 19:43:44 GMT (envelope-from git) Date: Wed, 24 Apr 2024 19:43:44 GMT Message-Id: <202404241943.43OJhi1F013988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6b0cf2a2379b - main - vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 6b0cf2a2379b86b67269ed4549057cd6d69490e5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6b0cf2a2379b86b67269ed4549057cd6d69490e5 commit 6b0cf2a2379b86b67269ed4549057cd6d69490e5 Author: Konstantin Belousov AuthorDate: 2024-04-24 19:06:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-24 19:43:32 +0000 vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled Reviewed by: emaste, imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44931 --- sys/kern/vfs_lookup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 180605f9eb8a..290834c10be5 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -86,8 +86,14 @@ static void NDVALIDATE_impl(struct nameidata *, int); ndp->ni_cnd.cn_flags |= ISRESTARTED; \ } while (0) +#ifdef KTRACE +#define NIKTRCAPFAIL(path) ktrcapfail(CAPFAIL_NAMEI, (path)) +#else +#define NIKTRCAPFAIL(path) +#endif + #define NI_CAP_VIOLATION(ndp, path) do { \ - ktrcapfail(CAPFAIL_NAMEI, (path)); \ + NIKTRCAPFAIL(path); \ (ndp)->ni_lcf &= ~NI_LCF_KTR_FLAGS; \ } while (0)