From nobody Fri Dec 08 22:03:03 2023 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 4Sn4rl68dXz53TkG; Fri, 8 Dec 2023 22:03:03 +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 4Sn4rl5Rrhz4Svx; Fri, 8 Dec 2023 22:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702072983; 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=X7eoRf3mqbGfApxMskoVYItjgbqoTHX/HWiPNwKz95E=; b=ohV4F1rMAFxMviYBuXKJTEemWozgrQEZEP1+rnrCPCWWq8ZgKhQf5l3z5un15ERO3ryctS brA0DZmU6FR6c7iNdS80JDcMSnpVejc+igSMKqvxoaVnTykJmE6Afv9IE/NCvDjrkv85oY QcO78nx0qCboD7c4NSM6kYrzRi1zI4t/jTRQ/p2l0Z5EKqA0sK/Qe4efJRQLABgq/CfoZx EK4k9jVlvCuCVwUYLAbVDWxSW3LWh4izQM5IcAD7qgKQYKUIMnUjjY+FibSt9diNbtR4ay Y5duQIms3dZfY0ba0vo38EWz1KDs0EKwYctq6fPwGx8KayrzFGUjM6hHghyYPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702072983; a=rsa-sha256; cv=none; b=Usl0Pyr2lf1SdiF4d4RHnLye7zUpf5fE4P9IUHPqg9xpbsyAAXbav4p1OrLdtva9aSmeF4 o5PjPHD8nyGNP6F+CrRyrmoEHal8UBfKMeq0rmeJsddFymrHgv9PciV6Tm74nxwPNfkkWO 4VTDPk82bvr90Ke5JlhfsVytl3Egagc+SoHyQRw44BYGZFNB0fRIspScfYbpBcvmNQxOSt mJ1OC6EwX7ykB+Ondy2sAF+73ZA8iKVAooNMEQEzIpXpKeT60C9ISmIcPLgqZvnSVbmsU7 mjQOXaEkuufMc6YGY5aZJvHQe1R+j/5oZaEKsSBkTyfniPGMINgIAxa6469Mow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702072983; 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=X7eoRf3mqbGfApxMskoVYItjgbqoTHX/HWiPNwKz95E=; b=mVKkyvCF54OG7YoxhofmVsm/YuGE4YDwMkskXnxRo+ljAridWRX63SZR/WWVO9xF2VMjVp uBjnwcxZWpRvLJdRLa0zNR0FcppU46M1ybEDRx+5l1mBfRwNG/qE/QK23dKBKKP9Z/+enq 26+x9y8ZxDRc4uzJaaRg9PUdq2UJGaiZPHIOBkCOYvDcaWTogbVeHmBiIcfoMPwvpccQzu txcIpWuVdfy8uFCfOOk4ypELGftwVTKgw6mCfyTs0RexVT2ChpLYp/3Iqv9UvBSQrLGlkf vOR7rmmiqoa6Fys+ZLsizxu8Jcp4/0a4RduQt7Hqm0NdybB4dsgwjn/eJKl46Q== 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 4Sn4rl4VYqzdp1; Fri, 8 Dec 2023 22:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3B8M333e020786; Fri, 8 Dec 2023 22:03:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B8M33hf020783; Fri, 8 Dec 2023 22:03:03 GMT (envelope-from git) Date: Fri, 8 Dec 2023 22:03:03 GMT Message-Id: <202312082203.3B8M33hf020783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9732eb8eae72 - stable/14 - ctl_ha: don't shutdown threads if scheduler is stopped 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9732eb8eae7294a47cd64af5f11221792a984f71 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9732eb8eae7294a47cd64af5f11221792a984f71 commit 9732eb8eae7294a47cd64af5f11221792a984f71 Author: Mitchell Horne AuthorDate: 2023-11-23 15:25:54 +0000 Commit: Mitchell Horne CommitDate: 2023-12-08 22:02:44 +0000 ctl_ha: don't shutdown threads if scheduler is stopped In this case, just return. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42341 (cherry picked from commit 9d61fd08499609a2c95d1c66f97587932b446f06) --- sys/cam/ctl/ctl_ha.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl_ha.c b/sys/cam/ctl/ctl_ha.c index 32c83025bb1b..1951f74c45f3 100644 --- a/sys/cam/ctl/ctl_ha.c +++ b/sys/cam/ctl/ctl_ha.c @@ -910,13 +910,16 @@ ctl_ha_msg_shutdown(struct ctl_softc *ctl_softc) { struct ha_softc *softc = &ha_softc; + if (SCHEDULER_STOPPED()) + return; + /* Disconnect and shutdown threads. */ mtx_lock(&softc->ha_lock); if (softc->ha_shutdown < 2) { softc->ha_shutdown = 1; softc->ha_wakeup = 1; wakeup(&softc->ha_wakeup); - while (softc->ha_shutdown < 2 && !SCHEDULER_STOPPED()) { + while (softc->ha_shutdown < 2) { msleep(&softc->ha_wakeup, &softc->ha_lock, 0, "shutdown", hz); }