From nobody Fri May 20 20:53:00 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 26CF31B3A5FC; Fri, 20 May 2022 20:53:01 +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 4L4f7d0cqyz3m4t; Fri, 20 May 2022 20:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653079981; 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=XoPuca6BV7WrUAIsrKcpctdi4WdC/MY8eCcON9e0vVg=; b=Z1jZe5K9z0H5H+ylmymd94W2NRoLa308BluRAF0cAzKZG0mT5XdmF4fe135TwS2bvut/Il FHvjxBrwIMOtVwPvXWbZtui5Q0wBDX9xQVwlnV3wtiVhqsyv/9nc6EcBwlfdK/FigfU2tC poCPU1sow2NBm7lm1ACskKz6WPPGh5hjH2zStq0g1g/fVLsqWBeplsfO+mQfLF9xIBFqxJ JlLsLyueDtXtmyH0qw2SjpuosmOdGwy96OyATtKCzydpdqeajERz2Zja9vpB1d1YIuUTQK p19V9qlk3ZZU0yOFTFBPAVRsRDZQgkwIGpyocKSSEScll2Q5MhUjdD5AW140HQ== 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 E9AB719828; Fri, 20 May 2022 20:53:00 +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 24KKr0ZA041512; Fri, 20 May 2022 20:53:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24KKr0oF041511; Fri, 20 May 2022 20:53:00 GMT (envelope-from git) Date: Fri, 20 May 2022 20:53:00 GMT Message-Id: <202205202053.24KKr0oF041511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9ac4d1af5a75 - stable/13 - nfsd: Fix handling of Open/Create for the pNFS server 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ac4d1af5a758fa49693ce4e09a2232f1175c9bd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653079981; 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=XoPuca6BV7WrUAIsrKcpctdi4WdC/MY8eCcON9e0vVg=; b=kAOX0CYIs+94q5STv8QxTYVPmS0uSyXm9oiI4Yh2Uv/E+ZjfTLtznVLsi581DRmHx4mCWX B7guwYpZDSaWE4z9200ivEgwf3mg/Wm2kreYIwAPBWaX0oLEKI89q/zS4+R6XPF6uijqYy bZmdmcUDsK8ThwoFGyKI1expOkA0ZgH1BrJqpxJoQ4uKu/xpUBOhv6qyduuv7+iZeY5k1f CobPx+B7kkAMiNjT2rQdKnoHkvOfPo1vx6crhX6WycySJ0BhfQehEXJsa/hZlJGjn0Yn+S 71ACzFk9ikXb879ekTaiwWjxRoAoVQFVg1b0eFxkVB6qZQd6d5vCs9ZKzfA+NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653079981; a=rsa-sha256; cv=none; b=u7zsI/N3+DJgXuy1mRBQwuJYxqHC88Iw4mWfj6Pbu8vj/3j/94Dgg3iCC+6nJ2CBWaJOIf jx8+BQcIRdHFvHeZf17z5kmdGcBkSc92WWXFWd3q+bWyg4IW8EkAbTiU//UxZE+jlkytUP xV3UDy/kdx0Muw+UBuCCuYVvuAR1EBB9xe69ULp2knHP9ZMihoRTnpNehehw0CR8IaAJPz XcwXqRZhgU/17zvSUP7QWG8/r76xBhEcYhmUOtufuL6Er57GlwYHI2I7GR+jiqHrcBIemM Q1LYfCUAVwE3nSbU95dDgIRN0EAM8H0Dni39LzpzwXkCpgDkntoXWn3aviS57Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9ac4d1af5a758fa49693ce4e09a2232f1175c9bd commit 9ac4d1af5a758fa49693ce4e09a2232f1175c9bd Author: Rick Macklem AuthorDate: 2022-05-04 20:52:33 +0000 Commit: Rick Macklem CommitDate: 2022-05-20 20:50:02 +0000 nfsd: Fix handling of Open/Create for the pNFS server When the MDS of a pNFS service receives an Open/Create and the file already exists, it must do a Setattr of size == 0. Without this patch, this was eroneously done via a VOP_SETAATR() call, which would set the length of the MDS file to 0 (which is already is, since all data lives on the DSs). This patch fixes the problem by doing a nfsvno_setattr() instead of VOP_SETATTR(), which knows to do a proxied Setattr on the DSs. For a non-pNFS server, the change has no effect, since nfsvno_setattr() only does a VOP_SETATTR() for that case. This was found during a recent IETF NFSv4 testing event. (cherry picked from commit f32bf50d43be1e898cebf751ce749b07d1301b8f) --- sys/fs/nfsserver/nfs_nfsdport.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 70243fa7ed2f..c25edf64094e 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1259,8 +1259,8 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, tempsize = nvap->na_size; NFSVNO_ATTRINIT(nvap); nvap->na_size = tempsize; - error = VOP_SETATTR(*vpp, - &nvap->na_vattr, nd->nd_cred); + error = nfsvno_setattr(*vpp, nvap, + nd->nd_cred, p, exp); } } if (error) @@ -1929,8 +1929,8 @@ nfsvno_open(struct nfsrv_descript *nd, struct nameidata *ndp, tempsize = nvap->na_size; NFSVNO_ATTRINIT(nvap); nvap->na_size = tempsize; - nd->nd_repstat = VOP_SETATTR(vp, - &nvap->na_vattr, cred); + nd->nd_repstat = nfsvno_setattr(vp, + nvap, cred, p, exp); } } else if (vp->v_type == VREG) { nd->nd_repstat = nfsrv_opencheck(clientid,