From nobody Wed May 04 20:54:01 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 C65EA1ABC855; Wed, 4 May 2022 20:54: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 4Ktpw95DGmz3w4r; Wed, 4 May 2022 20:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651697641; 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=srGz76eBTL9iHDOudQcYAy7l1SAFt+edNdjj6HL8p20=; b=ln8GA1VSyQva8FyEcG1Va9xxVt2gvSQGhsD5wvYMxOmGc+y5CSt1d7GC8wIBK82TRgi6j/ 9XVzjpdFcrRzDYRnu5ImQO/S8J2PJTOLePyMT96VYM+NshHG/Fji1fS4SvggCVCPIbwxxy Ie8uTNSURDymfT5x40FC9c+29R4UA8IepI8+A71maPFvcKlj7N1WrCbGiYfbXv0/5FOy6R QQPBpfj6lrkX2duSUVtX3P5x3fedGc7PFgSGuoI7pHHelIINrU5Tt+YhXhGNHXl2PX0IIi bVMkUFHmbdd6eRKj2eX0Bjj4lmuYyvfn82sbWzW37KT/mldJTlggkrHUsTol6w== 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 94B3E1A1F4; Wed, 4 May 2022 20:54:01 +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 244Ks1Sr079899; Wed, 4 May 2022 20:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 244Ks1Cu079898; Wed, 4 May 2022 20:54:01 GMT (envelope-from git) Date: Wed, 4 May 2022 20:54:01 GMT Message-Id: <202205042054.244Ks1Cu079898@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: f32bf50d43be - main - 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/main X-Git-Reftype: branch X-Git-Commit: f32bf50d43be1e898cebf751ce749b07d1301b8f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651697641; 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=srGz76eBTL9iHDOudQcYAy7l1SAFt+edNdjj6HL8p20=; b=kVcyhr2Vrtx+4u+zcqb2IT17IzmEDSvSKpWuzhPihLJd2H41ULOEBqIL9Vw+B6qOisbNpP wVAJk8balwyQsc9k6p9pHoE0udXxdh1IonDgPL6w2n7pzWqXSMb0tZmrAoxnmtop/Xc4K0 MqO8phepaZdN+Wq7cePaOhnjfSaoBW4J77KDQ1/P9gng55PtlimfNKG+E/tIHeCXGPz0xc kOpHLjKrmbI7+cjkuytV04Ef1u/3+8tAyGmDIQzTi35Te+7o92l37ynQXlRrSbNqwSJ61S +ZZGePp/DiC/1JSuGOoG5CIeO4TdxsLRRbMU5xr0xuB6i+geX3NB8xatjO0RsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651697641; a=rsa-sha256; cv=none; b=atqRST8COkPchR/u1TplvxCvTFnSxrcLu/lPxdiiSSa3S542niVswaO4RNq9QWFLPEbn/e jdEuvj/zITkT1t0gyWfLYztC4T5qyyIAu1nqCvxoAob3VSy4+k3vN6C9/avcQPdLTaIqdE gPSpqhC6KWtbsc0SfE68tOlv65f1WxQd1MIunYPaLNsezyZcCMksbYqhAYYzRaOQo9La0b QOEQe3vSfinWt53eDoqtZ4HUlDUbwl177+poMyHfdAywGZ5QbmzAn5d+h/YaxAH7UtIFcJ h0QXDuKhvSg17OFNIuPm3hqdwq6mqmVBR697lhkxaMVZ4ZhtVZOyxLMWu7AWTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f32bf50d43be1e898cebf751ce749b07d1301b8f commit f32bf50d43be1e898cebf751ce749b07d1301b8f Author: Rick Macklem AuthorDate: 2022-05-04 20:52:33 +0000 Commit: Rick Macklem CommitDate: 2022-05-04 20:52:33 +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. MFC after: 2 weeks --- 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 5dbe20f7a66a..c9238de00bea 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1260,8 +1260,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) @@ -1930,8 +1930,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,