From nobody Fri Jan 17 07:28:22 2025 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 4YZBD71KZSz5kbN1; Fri, 17 Jan 2025 07:28:23 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZBD66xfwz419H; Fri, 17 Jan 2025 07:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737098903; 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=gbQKCRPsq9hFAMngOcSfUn4uhlhczcTw7AHO8AAijPU=; b=amh0L0L+v8wrxHPkGYP9aesrj1MUFWwkfePUiV8jI+bbSFoAHdLUhIwqYiIdlk9tRFyxKK phglP12+85Bopm/AZbLUXbiGHle2ji/ixf0ZvFjPrIMmc2Ky8CWe2GbHCCO0GCbqXqkWrs k44o4gZ6aA9cg9Xqc3dr7X46RklyYCh8XOEqO0NVIh+h+Wwzl9nQ9Rrb36naiV3ieC3V1j TjI6Fv2KE9oXSyx9GZeU8PFE6g9cZ1p8FsARbC6WLgJ7BQEILUjrfdmXBeFVyp6sXLiCiy N/i/IyLrfGnbkFLieGgQMM5lyLfFAh8+MiHZL9lnCDXO2/X3A1kiA2FKLOsGqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737098903; 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=gbQKCRPsq9hFAMngOcSfUn4uhlhczcTw7AHO8AAijPU=; b=qhtPUZuDt2lDKXl9Fj40ohIr4dLU5Pjpf0/JJLGeMLEO2ymLk3RBbEaNRwBXlcKUmJyrdI mh8q4pY11Y6JAaoKjETkmsHuCyAOUtPkjuFWRpJAwZ5uQ95nT4rDo/kAdOlOyH+kX8R3mR RAIO9E7haCZpfF/3yLZPbYb3VFq1RKNRXucGp7KWoZCCF1AMIT4ApTBxy9L4RjHmgkcmis xItbu42cLNZ3CdUSsTyvlqSoqHC52UHKJ32QXDfyWSI/aQdDA8w7oYPW2snz7WnY4flJtV 5x2570ZrFk5J4FSxvck5NulySmsPT8kKnRCMkMDR1nOIUFc8CEGIef6pK05oWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737098903; a=rsa-sha256; cv=none; b=e3yQJ7YALKaK5lS7DUc828uvadq1kJ3AX4M29iQCuUlkfGBqfUt0w9RRHqeLHONv25C5sT LRZ6JckrWrsreS5MtlWmh2u8XExgRCikDC8tIeL4s6sR35UcCSPm6m1A345v8G2pNYIyXt 9YhgMoiUf5IwxmZyOuxO1YqvnxUcfMxNkwp/nPRZCp8IHSI8/WuiW147TOm+g8xWQCeY7t pnVK6kfbzJndgOW9hq61rnb/m9vYY4AAzhc2kGz7I5WWUv20ZMMykMqEstLH+HFFHrtDN8 inADOhSxJ/+iun7pIhONmePsM+9Qxj4MR4Wv4W7sN2A1iiwqC+uSqlqx+f3IBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YZBD66WWjz177M; Fri, 17 Jan 2025 07:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50H7SMrs091952; Fri, 17 Jan 2025 07:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H7SMLU091949; Fri, 17 Jan 2025 07:28:22 GMT (envelope-from git) Date: Fri, 17 Jan 2025 07:28:22 GMT Message-Id: <202501170728.50H7SMLU091949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d9f9a73a3363 - main - krpc/clnt_vc: in clnt_vc_destroy() use more lapidary logic 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9f9a73a3363737aef4bae8ef6d71a2159005436 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d9f9a73a3363737aef4bae8ef6d71a2159005436 commit d9f9a73a3363737aef4bae8ef6d71a2159005436 Author: Gleb Smirnoff AuthorDate: 2025-01-17 03:59:30 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 07:27:21 +0000 krpc/clnt_vc: in clnt_vc_destroy() use more lapidary logic on whether to close the socket or leave it. --- sys/rpc/clnt_vc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 2f2674e694af..e201072b2ee7 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -849,7 +849,7 @@ static void clnt_vc_destroy(CLIENT *cl) { struct ct_data *ct = (struct ct_data *) cl->cl_private; - struct socket *so = NULL; + struct socket *so; SVCXPRT *xprt; uint32_t reterr; @@ -867,19 +867,14 @@ clnt_vc_destroy(CLIENT *cl) SVC_RELEASE(xprt); } - if (ct->ct_socket) { - if (ct->ct_closeit) { - so = ct->ct_socket; - } - } - /* Wait for the upcall kthread to terminate. */ while ((ct->ct_rcvstate & RPCRCVSTATE_UPCALLTHREAD) != 0) msleep(&ct->ct_sslrefno, &ct->ct_lock, 0, "clntvccl", hz); mtx_unlock(&ct->ct_lock); - mtx_destroy(&ct->ct_lock); + + so = ct->ct_closeit ? ct->ct_socket : NULL; if (so) { if (ct->ct_sslrefno != 0) { /*