From nobody Mon Nov 1 02:04:32 2021 X-Original-To: dev-commits-src-branches@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 A37631826CDA; Mon, 1 Nov 2021 02:04:32 +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 4HjGYr4Dctz3Jkh; Mon, 1 Nov 2021 02:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 716EBE28; Mon, 1 Nov 2021 02:04:32 +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 1A124Wxq012035; Mon, 1 Nov 2021 02:04:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A124Wsx012034; Mon, 1 Nov 2021 02:04:32 GMT (envelope-from git) Date: Mon, 1 Nov 2021 02:04:32 GMT Message-Id: <202111010204.1A124Wsx012034@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: d37e54c771d3 - stable/13 - nfscl: Modify Close RPC so that it does not use "owner" for NFSv4.1/4.2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: d37e54c771d300665383e0a19d8ce8bec35e42e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d37e54c771d300665383e0a19d8ce8bec35e42e4 commit d37e54c771d300665383e0a19d8ce8bec35e42e4 Author: Rick Macklem AuthorDate: 2021-10-18 00:50:56 +0000 Commit: Rick Macklem CommitDate: 2021-11-01 02:01:03 +0000 nfscl: Modify Close RPC so that it does not use "owner" for NFSv4.1/4.2 This patch modifies the function that does the Close RPC (nfsrpc_closerpc) so that it does not use the open_owner (nfso_own) for NFSv4.1/4.2. Use of the seqid in the open_owner structure is only needed for NFSv4.0. Same applies to a NFSERR_STALESTATEID reply, which should only happen for NFSv4.0. This allows nfsrpc_closerpc() to be called when nfso_own is no longer valid. This, in turn, allows nfsrpc_closerpc() to be called after the shared lock on the clientID is released, for NFSv4.1/4.2. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. (cherry picked from commit d95c0a12a2dd58b4b13cbc2d1a9fccd848f8ac5e) --- sys/fs/nfsclient/nfs_clrpcops.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index fc7d8687be77..ab25306a9c29 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -866,11 +866,13 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, op->nfso_fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); - *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); - if (NFSHASNFSV4N(nmp)) + if (NFSHASNFSV4N(nmp)) { *tl++ = 0; - else + *tl++ = 0; + } else { + *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); *tl++ = op->nfso_stateid.seqid; + } *tl++ = op->nfso_stateid.other[0]; *tl++ = op->nfso_stateid.other[1]; *tl = op->nfso_stateid.other[2]; @@ -880,11 +882,12 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); if (error) return (error); - NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd); + if (!NFSHASNFSV4N(nmp)) + NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd); if (nd->nd_repstat == 0) NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID); error = nd->nd_repstat; - if (error == NFSERR_STALESTATEID) + if (!NFSHASNFSV4N(nmp) && error == NFSERR_STALESTATEID) nfscl_initiate_recovery(op->nfso_own->nfsow_clp); nfsmout: m_freem(nd->nd_mrep);