From nobody Tue Nov 15 21:36:49 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 4NBfdY2pGCz4hpMm; Tue, 15 Nov 2022 21:36:49 +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 4NBfdY26c4z4lNG; Tue, 15 Nov 2022 21:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668548209; 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=IHb84kg4UlljpClyKRKETv4qmtYVDcvRi1mqgT0x6qc=; b=aLb61fmN31gmdlG0sADBfDEAvdJpK5sTnZKmP42ydDlLdIsw6BGHliL4cSxKZs/LW5Krwj xgU2X19nx7LKUWfaAGHGAMx4Z8PkRLgU+IZBdUa8xw24PZOy34s4JezX/rllmclSVt/rrG uuPNGIGlHM3nv+gF1jEBdIfBNET9NbPF45nw4Mwsj/i/hTDa9yWK7Fhi749JZ4TyoHYf/B /gzR6s2nWfuM0ZedkUMF5g/ELPXDg0q0e+bGATWG0JtXMYhGHtyKro4clr8xLiac7pKNAy HUb4QvoqkvTDUuhiOG+RK9ljBF/T+P0hBMZGktr7mKnksskaqSSuhAeOiqEssA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668548209; 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=IHb84kg4UlljpClyKRKETv4qmtYVDcvRi1mqgT0x6qc=; b=vRfxDUMKkbZl91kSVpb8UDpM/vHgbzzRNuQtL5TlRjBGDwhwVzZWcZoF2HlmW+anJS/EJX 8OpNWLL4RFXIyDd63VBgj46wmeeDL+bGKTvDXejnCoqjGT6KmtqvuwsVfZjrsYySPh7/7X Ywv35m38aAWuuleDK0syKqXzy5ZDpzIwTOC9o0iZ2PVufH02zVb6FlbwAe/Re2735nOru/ bda2WhJEZhtbsaeKm5+sYVsVk4MldWXXTSLazWUOEu+MdMcEyrcjZF+nS5ElFGLL7UW80p A/9LEW1IWeuikeIR9mW0A9LHxzNPwCjWypb83qtz3TuNhUXRs/JKaErbl67U8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668548209; a=rsa-sha256; cv=none; b=ZI6Mr0zbOVVYwyctPYKw2lLjcz3yAEKVfdFwpUCjwgxri4VB+ZsQyos93S8vFAPj+q3KR4 Rk+8h/qFxFFOa4nCbOqaEZklDY9p7EqTgjjDh8TtEtI+19vu29wvkrnyu5nzo7lRJ4KbWu UBfzR1PvXJcbk7i5xTwqE7uZW+qu7nusDzCAYHJN2x2O8E3fvqE43uRCAEcPp0MFIc1iS1 /KtCxqZ4mcpNdGoSJCF2kcqVjymJXhj5YcVxdgNXZI9EXFa9JFcMo3Sq/5qqHfpVhefngR Mq4LytTcQiUKLJtCdNPX1/sXjsQ2Z0RxlVXL4HjN3h3E6Fp9l4hGIyGSpfwL3w== 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 4NBfdY1B9Xzd8K; Tue, 15 Nov 2022 21:36:49 +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 2AFLanId057209; Tue, 15 Nov 2022 21:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AFLan0W057208; Tue, 15 Nov 2022 21:36:49 GMT (envelope-from git) Date: Tue, 15 Nov 2022 21:36:49 GMT Message-Id: <202211152136.2AFLan0W057208@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: a265108447f9 - stable/13 - nfsd: Make Setxattr/Removexattr NFSv4.2 ops IO_SYNC 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: a265108447f9db3e320c163c429c87b15ecbea0e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a265108447f9db3e320c163c429c87b15ecbea0e commit a265108447f9db3e320c163c429c87b15ecbea0e Author: Rick Macklem AuthorDate: 2022-10-16 20:27:32 +0000 Commit: Rick Macklem CommitDate: 2022-11-15 21:35:00 +0000 nfsd: Make Setxattr/Removexattr NFSv4.2 ops IO_SYNC When the NFS server does Setxattr or Removexattr, the operations must be done IO_SYNC. If a server crashes/reboots immediately after replying it must have the extended attribute changes. Since UFS does extended attributes asynchronously by default and there is no "ioflag" argument in the VOP calls, follow the VOP calls with VOP_FSYNC(), to ensure the operation has been done synchronously. This was found by inspection while investigating a bug discovered during a recent IETF NFSv4 testing event, where the Change attribute wasn't changed in the operation reply. This bug will take further work for ZFS and the pNFS server configuration, but is now fixed for a non-pNFS UFS exported file system. (cherry picked from commit 8063dc03202fad7d6bdf34976bc8556fa3f23fa1) --- sys/fs/nfsserver/nfs_nfsdport.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index d834c71041c8..258642bb1060 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -6568,6 +6568,8 @@ nfsvno_setxattr(struct vnode *vp, char *name, int len, struct mbuf *m, if (error == 0) { error = VOP_SETEXTATTR(vp, EXTATTR_NAMESPACE_USER, name, uiop, cred, p); + if (error == 0) + error = VOP_FSYNC(vp, MNT_WAIT, p); free(iv, M_TEMP); } @@ -6603,6 +6605,8 @@ nfsvno_rmxattr(struct nfsrv_descript *nd, struct vnode *vp, char *name, if (error == EOPNOTSUPP) error = VOP_SETEXTATTR(vp, EXTATTR_NAMESPACE_USER, name, NULL, cred, p); + if (error == 0) + error = VOP_FSYNC(vp, MNT_WAIT, p); out: NFSEXITCODE(error); return (error);