From nobody Wed Nov 18 18:02:55 2026 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 4jV8b40P57z70xmw for ; Wed, 18 Nov 2026 18:02:56 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jV8b36M7Pz4jvg for ; Wed, 18 Nov 2026 18:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795024975; 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=TPafccpbgSIDwtvp40jjTGlP3rxh1D3emIBIpFF/hpw=; b=U7ujIcTuyw0/sriN6TeezFwTJuTXUwNqdshDn2rv3zqSXS8kcmizA9je1w6/eHyuBGLlCE oEy4Q+S8jXXbSkxd9el6xJ9qb8KCnLGqply9bAo1VrjFrGgO8kNGlQN2CqMmuXCaVuhbWw +oubLnaMIV4VXlbk1ycNxY/gNkU8Q3TAfiyzEixRRldysu2KXXnFO1eVX0XGOun07vgSsX 4mz/8PTC2CNe+8jD8ykzXOHbTQg77pkA75jj+RGmnWQH+fP+8/0Zh1RwRD+yz10EOHDVsY sG73i1iOb5SIon2AFNR4yuvXmcurzH09Ug7vVdRuFQ1hHGacz3ZGS3mQCeBLbQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795024975; b=mfg9LO1YR9EY30uOZWWyrbFBwOlDFP/JidIUqK/oBXjTqspjQcVY8i3ynzR0DqEDcvCYLj 4qjNYWE1VY05J8enrVy7tQ6OQwuQYwlxNHPkPErQOtZRJ00hotG4msWpKVXzJXDwSqX7y4 SY2uVX9V3HtEFhNLdV1yY2t0fnWqxG8W7p94kWpZJ2fu0Fn+ufWfMaZ7e4DVPQvvG4IQcK V2UbBUVUZnqm3oFuTnLghgXOfc5u1PsSgL3R0a/PdnkecLmt+ZDxfWs1RB/1AqY+ExBvsy ie2b8PdnDVLTQBh7kLluWwFOCWhs4bjQdqcnvwFQvAOEyZDtbOcN7EqBOY+yMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795024975; 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=TPafccpbgSIDwtvp40jjTGlP3rxh1D3emIBIpFF/hpw=; b=uIZ5QrBWlu94zjPQnQkX7l4iMDl3nJnJLeMfrVM3SO7Q0+R9ewekMvrVeYPsgYzu5ZqmkB vKZnYAFLOvm5V/ck3Fy085V6up2ijHWVm9N1BAMCO0WBBz+0PvwuZvmESdMXr+CQtCiUS9 nY0AGg2txoB2IzKlzms/AlPmy7KhQ/s+ovqdfminzpJ06VyL58CatfpUYbE1J5zIOrvUKF axo5BNv/o28aJ8Xie0mSWd2p/ymTcb1LeRR5RvTYF8KtGNrrmg/fe02CBWa4j48jpxZU17 yzF6Rd5wECROjm1wjRVoQsTIXlA28tejrfoo1FNNjhOpXJoQXiylR/re+tjBDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jV8b3626KzPJ2 for ; Wed, 18 Nov 2026 18:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e018 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Nov 2026 18:02:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kenneth D. Merry Subject: git: 5d18a804737e - stable/14 - pass(4): Don't drop the periph lock before selrecord() in passpoll() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5d18a804737e7a8830daec423b576fa83ab39e4f Auto-Submitted: auto-generated Date: Wed, 18 Nov 2026 18:02:55 +0000 Message-Id: <6afde84f.e018.7a9492b1@gitrepo.freebsd.org> The branch stable/14 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=5d18a804737e7a8830daec423b576fa83ab39e4f commit 5d18a804737e7a8830daec423b576fa83ab39e4f Author: Kenneth D. Merry AuthorDate: 2026-11-11 14:26:19 +0000 Commit: Kenneth D. Merry CommitDate: 2026-11-18 17:37:45 +0000 pass(4): Don't drop the periph lock before selrecord() in passpoll() passpoll() checked the done queue while holding the peripheral lock, dropped the lock, and only then called selrecord(). A CCB completing in the window between the unlock and the selrecord() call sent its selwakeuppri() before the polling thread was on the selinfo list, so the wakeup was lost and select(2) or poll(2) slept until another completion arrived or the timeout expired. Call selrecord() before dropping the lock. This lock order is already established: passdone() calls selwakeuppri(), which takes the selinfo lock, while holding the peripheral lock. kqueue is not affected, since the knlist is backed by the peripheral mutex. Reported by: llm-postcr Fixes: a9934668aa13 MFC after: 1 week Sponsored by: Spectra Logic Assisted-by: Claude Fable 5 (cherry picked from commit 88c5709e91ad2cc6df51380673837f0ebd8a2d50) --- sys/cam/scsi/scsi_pass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c index 3215b66454a1..1926ea40f6fd 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -2111,9 +2111,9 @@ passpoll(struct cdev *dev, int poll_events, struct thread *td) if (!TAILQ_EMPTY(&softc->done_queue)) { revents |= poll_events & (POLLIN | POLLRDNORM); } - cam_periph_unlock(periph); if (revents == 0) selrecord(td, &softc->read_select); + cam_periph_unlock(periph); } return (revents);