From nobody Fri May 20 21:01:09 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 0FFA71B3C89D; Fri, 20 May 2022 21:01:10 +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 4L4fK172N6z3n6s; Fri, 20 May 2022 21:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653080470; 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=3H48TYHo9tbHjPBx2VmOrGa8xKjS+YixgRmLVyDssRU=; b=P94R80NMbx3VY9LAL4CUGRTuEtVlQ2sFUTk3y7u6zvGzVqKxK7QhF/Euse3nxbkJ2jWXJI hwe/nwTKot1x8wL5YgRfF3bSwdKJVDKZWgegpXjSHk5TQofOSwXfbw22EV37R9pEF9+xnX kIOxBIxnbmT7WdDVPrcElq/9riE9cTYe5b/oSoxmXewKLV9CU+zb/KM2vWrc/vB33vFbri UjboQl4zGMDtEF3sfxrZzAYja9dBkXdL17LRM3LMaRjIY7h7gdEsTVkIWUvS9ofws9iWfu vinvJ3Zj2HDd8OyoFksWc1NLQjj+va6QacwtsLYSyJBEg3IczuFEqfcL1MUQJQ== 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 D1D5B19830; Fri, 20 May 2022 21:01:09 +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 24KL19Hu051387; Fri, 20 May 2022 21:01:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24KL19ME051386; Fri, 20 May 2022 21:01:09 GMT (envelope-from git) Date: Fri, 20 May 2022 21:01:09 GMT Message-Id: <202205202101.24KL19ME051386@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: d5c176ad6a7b - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: d5c176ad6a7b0cd78e3b893284b292e18ecb804f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653080470; 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=3H48TYHo9tbHjPBx2VmOrGa8xKjS+YixgRmLVyDssRU=; b=FeVeYcwXUG/GUhI9WH/5uz3zXh/Dukrg6t7eVLrKbWGc+UTqirOXk/r0oIvuUgi+kiQ6tR AhcI/Di7EBmYEySskD4LNWN/928G2iX1rYx9zWy0hiCbtYLOUJ48/Tl97t5aioJ9lX5G/d m6Uj4+YCUg0xldlh5UHzW6xfMUXQMa8c2ob2eIM3PbI+DGjFkuoCmbWOLRJndAdGMeKsjh T/u/YjgMEjtQBrcb6IOWuz690Fu02bq3xw1KE5XNLI66KPkbRZL42yPA4NWHDlGBMbADuN x9PTgOj1vYVAMAJdVp4bx+1bM0I54LVTB+LcxtNYtGfOAu+WTtwaTn1SoFCKSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653080470; a=rsa-sha256; cv=none; b=cV4ae116eGOZ7E7bQZC/WjrbhGPzdXnnczw84bkqB8alg9qExfkv+O/9u4jt0Mdr8BWXLE 1lHT8LQc+3opnX3Mz9RZf9JYokpZUe/2lEt045RNbea/gxckhKCifr6Vvf28ktAvmKLtDs ZnKHLIbrlEnmJGcunwBd50/VdQile+mTQs2dorgW4CCKqGekVhqwLZr4DRyQzX5j0F+kDa ZJ9IYI8xYiqdQDbbR6YsiUrLmMkJBiLz2mubpAi3qMsDh5NYrBNOBKwt84pDfjPrK+vlgH Z9OHTkjTg/4TXStJwBHGH086GPnNgwJwaYoPQGYjTOEqhU0/3ueW7siZ1KjOqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d5c176ad6a7b0cd78e3b893284b292e18ecb804f commit d5c176ad6a7b0cd78e3b893284b292e18ecb804f Author: Rick Macklem AuthorDate: 2022-05-04 20:52:33 +0000 Commit: Rick Macklem CommitDate: 2022-05-20 20:57:49 +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 0f3852318068..a76f0ff0554c 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1044,8 +1044,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) @@ -1709,8 +1709,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,