From nobody Wed Jun 12 23:18:24 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 4W01gP1JKQz5KxBF; Wed, 12 Jun 2024 23:18:25 +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 4W01gP0rGpz4bGC; Wed, 12 Jun 2024 23:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718234305; 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=mRvCl+6b5p8C552Nn8R5vVBqAGhUXkbf/f5dKWUFbyk=; b=G1wUoO8Md4BqJ7U2ZNITidP3SijF9n3M5B/AohTVi6r+AN90ZEeFwMHyTHy7kYkhhiA3UP 0QD+Ql5lWJ4Sa/WEgWtS1m9XiZwbvzm5Zxx0zgcCbhc820sHelb33c0g63RCurPaLPz70m SKLNE064hy0dBcjLqXxYqS5qo46a9IGU1g1R6oHlUFyq5N68iRtHsvn0nhlSbIroUVLttr r3DLjXOwIundVrMJVeWUs7iWK01tlFkqwJlS7jW/it6xDY3/OpXuYrsrMEnfUfmA0RvG6U xisA9wq8i3iApJpBe+ZzBCDvfYiTHnDceREWH6OtaPfK3X/x3ATFRNIlwv9QeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718234305; a=rsa-sha256; cv=none; b=CrQ2IhXVH2HRCJy2SsKvQwGNGGU4u95aEDrjK3omBv/63fndIOIkfbSbE4+Sz11I6x+CqR g2VGmp4KZ0I3hJRwqDXf5+a/JKORLx2pWQOGR9djxnikgX0nflM4IWIDuptTFeOQqAfGhB 6pDL2nGu5zXASXE1hwrB0a3s9UupRV0CA7f6G/sgoBse8eV1SzCKs/p5sVF0L7ZqYmtnOL vJF9N4TGJUCrRPwhWfsLZ4HfOdJW1kQ5GlZ5qrbTlci3M0YH27GyxVojcg0AiZGjl5cKO4 sC8qVzkbmjDj20PIZMY7/O/yjMA+xpqwtR9C0bP/qm9BMOFMgN9hia6ts0pvMA== 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=1718234305; 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=mRvCl+6b5p8C552Nn8R5vVBqAGhUXkbf/f5dKWUFbyk=; b=bcWn9jky5NLjwoaBb6DaNEJtZY8ujJxG2a13kGwnbL7GH3Zt78qy3jrPZudavXrI73REGX rTuxw+ZMoanT+lIQc+amYzrN05OqJJ0mvGr3OVmZA7EvzdQjAb7M715+qL5Be1qvBA3Q7O buSPFkvxlT3hhsOrS+CO7/cn+ALfHLcDJqctyjCKdR7n3IXm/MaNpmPkpO0IcHDNJtP4Yd UMNAwmwowOVyX3sQ0dwI04UTlims3OpuVzzQLVS7iGKh8cV/UZgztjqzwl8H1apLsJy7sb aULX83D2RobMVHp3HmVBNdoz5wZRR1tWjBaGmkixrXPnoPpfAk2JGHaatGDMHg== 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 4W01gP0KKMz1Bcx; Wed, 12 Jun 2024 23:18:25 +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 45CNIOx1012078; Wed, 12 Jun 2024 23:18:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CNIOVa012075; Wed, 12 Jun 2024 23:18:24 GMT (envelope-from git) Date: Wed, 12 Jun 2024 23:18:24 GMT Message-Id: <202406122318.45CNIOVa012075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 4308d6e0fc09 - main - nfscl: Add a check for VREG for delegations 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4308d6e0fc09c807483f09b8fea7f5182d19fd01 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4308d6e0fc09c807483f09b8fea7f5182d19fd01 commit 4308d6e0fc09c807483f09b8fea7f5182d19fd01 Author: Rick Macklem AuthorDate: 2024-06-12 23:17:23 +0000 Commit: Rick Macklem CommitDate: 2024-06-12 23:17:23 +0000 nfscl: Add a check for VREG for delegations Since delegations are only issued for regular files, check v_type to see if the query is for a regular file. This is a simple optimization for the non-VREG case. While here, fix a couple of global variable declarations. This patch should only affect the NFSv4.1/4.2 behaviour when delegations are enabled, which is not the default. MFC after: 1 month --- sys/fs/nfsclient/nfs_clstate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9fbaa6e63a56..aef5d71592af 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -93,9 +93,8 @@ NFSREQSPINLOCK; NFSCLSTATEMUTEX; int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ -int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; -int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; +static int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, @@ -4647,7 +4646,7 @@ nfscl_mustflush(vnode_t vp) np = VTONFS(vp); nmp = VFSTONFS(vp->v_mount); - if (!NFSHASNFSV4(nmp)) + if (!NFSHASNFSV4(nmp) || vp->v_type != VREG) return (1); NFSLOCKMNT(nmp); if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { @@ -4687,7 +4686,7 @@ nfscl_nodeleg(vnode_t vp, int writedeleg) np = VTONFS(vp); nmp = VFSTONFS(vp->v_mount); - if (!NFSHASNFSV4(nmp)) + if (!NFSHASNFSV4(nmp) || vp->v_type != VREG) return (1); NFSLOCKMNT(nmp); if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) {