From nobody Thu Nov 18 22:59:38 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 6C89E18981A5; Thu, 18 Nov 2021 22:59:38 +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 4HwFcB2cpRz4ZXl; Thu, 18 Nov 2021 22:59:38 +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 35ACC1D6EA; Thu, 18 Nov 2021 22:59:38 +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 1AIMxcWQ078816; Thu, 18 Nov 2021 22:59:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AIMxc52078815; Thu, 18 Nov 2021 22:59:38 GMT (envelope-from git) Date: Thu, 18 Nov 2021 22:59:38 GMT Message-Id: <202111182259.1AIMxc52078815@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: 5d9215b315a9 - stable/12 - nfscl: Move release of the clientID lock into nfscl_doclose() 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/12 X-Git-Reftype: branch X-Git-Commit: 5d9215b315a9e2b90d36ba90c4a8c84306bcfee4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5d9215b315a9e2b90d36ba90c4a8c84306bcfee4 commit 5d9215b315a9e2b90d36ba90c4a8c84306bcfee4 Author: Rick Macklem AuthorDate: 2021-10-16 22:49:38 +0000 Commit: Rick Macklem CommitDate: 2021-11-18 22:55:24 +0000 nfscl: Move release of the clientID lock into nfscl_doclose() This patch moves release of the shared clientID lock from nfsrpc_close() just after the nfscl_doclose() call to the end of nfscl_doclose() call. This does make the code cleaner, since the shared lock is acquired at the beginning of nfscl_doclose(). The only semantics change is that the code no longer drops and reaquires the NFSCLSTATELOCK() mutex, which I do not believe will have a negative effect on the NFSv4 client. 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 e2aab5e2d73486aa76bb861d583bbce021661601) --- sys/fs/nfsclient/nfs_clrpcops.c | 11 +++++------ sys/fs/nfsclient/nfs_clstate.c | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index d6072bf2523e..f2eb3af5f101 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -716,13 +716,12 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) return (0); if (doclose) error = nfscl_doclose(vp, &clp, p); - else + else { error = nfscl_getclose(vp, &clp); - if (error) - return (error); - - nfscl_clientrelease(clp); - return (0); + if (error == 0) + nfscl_clientrelease(clp); + } + return (error); } /* diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index ad4f16df8be8..9bd9b8759c51 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3267,6 +3267,7 @@ lookformore: op = LIST_NEXT(op, nfso_list); } } + nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); /* * recallp has been set NULL by nfscl_retoncloselayout() if it was