From nobody Mon Nov 25 19:36:47 2024 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 4Xxwv34pbpz5f5Tn; Mon, 25 Nov 2024 19:36:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xxwv348fhz4d5q; Mon, 25 Nov 2024 19:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732563407; 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=BFCOonRjCISPugFP0SaqG/jE/bcG7ZsFRF94kNO+XxY=; b=qn1b0SREZ6gpHFFvp/tGcI0XMLciytLYP6gqP8GmOUhJIdRmdjNqIY82l2124SuTFdu0He wju7gy1BE72gOo85CrjwbNxLSnbZYSdjVRiCApD8qbJa2i1hCnK4HyvymMbrLRRAvaGBl/ VOc6Z6P6BBzqygQTtccclOYC4ktujb79xWJ8NkxaUK1FBSMeKwQsygPXgcRfhSp1SNmEjE 5KTpFpalNlOVBVWNCWtL+PjOLe5GVXAXCV9vgFJ/YfUTayUoL0qTOs4R6zduepFoQxLPMr jJzB7KZ2XKVHjLw1fgDvmYQJaw4E0x/GW+khsV7MpBU1xwNed59mSfLcBpt8Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732563407; 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=BFCOonRjCISPugFP0SaqG/jE/bcG7ZsFRF94kNO+XxY=; b=FcNjAvpxOngze589fIQgZipAtdB3C0p8Y/cRSUcX3yJ/pszrqzYevYYas9CD/HFVO3gXMp nK/u+ih8ZYy/RbCiy+iAOUmrteF5U2jq/2Jb/ySDY6NiM+E3vGah/fD3jNhRUouVcXlxp7 Lrv6deg775dXv6Tvkxt4bUn/Jzwj2a5t2tM9HZAldTqgB1D6BZsf3qJbY5Oaz53C9b6wNj fXMtr1F22Or8DqUUeeGo6Hshh7bcWg43iTZw3rD4YERasefP97h+57Arih+31YYOHtdLOb cPXabIGSdDKqjXr0q8wRiFLfiBAGLpUeNIaUZsiC4rx160oehivnkb8qumgnIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732563407; a=rsa-sha256; cv=none; b=Dk+OguPAS8dfc6TgDzKr4RUIYbsO7f3M5xQ1CASh1eyZ+mkJhG32HiBailCYp8Aro9htV7 y99lmGUFpDZPAGlo9ulrguL1W0AvEqGXQlq02o4Tcav0F/s3JhmdUYEjfOUxuDTkPN7ytv mhQ+zuurC72QzjojPcGDeMl4BC0mMHtiDhlDXcIZ2DtXf4n3wEZd2yTLFx1DcIRx3cSXMw CK2Ptvgt2TL/tTTllZRGUtmcJ18bFRqitDbiPbe5ZjVwY5AVQnuWrHkGFA7gfbvWxH65Jl VwanL1lEVCkbTepjhXqqBOTHsxklJZLmatDPyN+3tZOFwFk/d0n/k2sLVJiVsg== 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 4Xxwv33lvtzt6T; Mon, 25 Nov 2024 19:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4APJaljC042092; Mon, 25 Nov 2024 19:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4APJaldc042089; Mon, 25 Nov 2024 19:36:47 GMT (envelope-from git) Date: Mon, 25 Nov 2024 19:36:47 GMT Message-Id: <202411251936.4APJaldc042089@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: 31784ee1e37d - main - kern___realpathat(): style 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 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: 31784ee1e37dc0337637493721c4c9b98547089b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=31784ee1e37dc0337637493721c4c9b98547089b commit 31784ee1e37dc0337637493721c4c9b98547089b Author: Konstantin Belousov AuthorDate: 2024-11-25 12:41:17 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-25 19:36:41 +0000 kern___realpathat(): style Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D47739 --- sys/kern/vfs_cache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index fa6b23fe3d6f..c4b4d59f3b40 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3265,6 +3265,8 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf, if (nd.ni_vp->v_type == VREG && nd.ni_dvp->v_type != VDIR && (nd.ni_vp->v_vflag & VV_ROOT) != 0) { + struct vnode *covered_vp; + /* * This happens if vp is a file mount. The call to * vn_fullpath_hardlink can panic if path resolution can't be @@ -3274,7 +3276,6 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf, * this should have a unique global path since we disallow * mounting on linked files. */ - struct vnode *covered_vp; error = vn_lock(nd.ni_vp, LK_SHARED); if (error != 0) goto out; @@ -3284,8 +3285,9 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf, error = vn_fullpath(covered_vp, &retbuf, &freebuf); vrele(covered_vp); } else { - error = vn_fullpath_hardlink(nd.ni_vp, nd.ni_dvp, nd.ni_cnd.cn_nameptr, - nd.ni_cnd.cn_namelen, &retbuf, &freebuf, &size); + error = vn_fullpath_hardlink(nd.ni_vp, nd.ni_dvp, + nd.ni_cnd.cn_nameptr, nd.ni_cnd.cn_namelen, &retbuf, + &freebuf, &size); } if (error == 0) { error = copyout(retbuf, buf, size);