From nobody Sat Oct 30 03:45:30 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 45959183991A; Sat, 30 Oct 2021 03:45:31 +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 4Hh4vH1R0fz4p3r; Sat, 30 Oct 2021 03:45:31 +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 115912388F; Sat, 30 Oct 2021 03:45:31 +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 19U3jViN011616; Sat, 30 Oct 2021 03:45:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19U3jUW5011615; Sat, 30 Oct 2021 03:45:30 GMT (envelope-from git) Date: Sat, 30 Oct 2021 03:45:30 GMT Message-Id: <202110300345.19U3jUW5011615@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: 627b15e81406 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 627b15e8140675f136e9f4e72a2204cac0316eeb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=627b15e8140675f136e9f4e72a2204cac0316eeb commit 627b15e8140675f136e9f4e72a2204cac0316eeb Author: Rick Macklem AuthorDate: 2021-10-16 22:49:38 +0000 Commit: Rick Macklem CommitDate: 2021-10-30 03:42:08 +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 795eafabb6de..fc7d8687be77 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -747,13 +747,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 4c74963da747..984d8382ee45 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3383,6 +3383,7 @@ lookformore: goto lookformore; } } + nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); /* * recallp has been set NULL by nfscl_retoncloselayout() if it was