[Bug 293899] panic: cam_periph_ccbwait: proceeding with incomplete ccb: ccb=ADDR, func_code=0x3, status=NUM, index=-NUM

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 24 Apr 2026 18:38:58 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293899

--- Comment #1 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3454d97aaec12f4a8c676c34182200471eecae24

commit 3454d97aaec12f4a8c676c34182200471eecae24
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2026-04-24 18:31:13 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-04-24 18:32:24 +0000

    cam: Set ccb_h.status on XPT_GDEVLIST early-return paths

    XPT_GDEVLIST in xpt_action_default has two early-return paths (list
    changed and index not found) that set cgdl->status but not ccb_h.status.
    Since xpt_action sets ccb_h.status to CAM_REQ_INPROG before dispatching,
    and XPT_GDEVLIST is an non-queued CCB, cam_periph_ccbwait skips the
    sleep loop and immediately hits the KASSERT checking that status !=
    CAM_REQ_INPROG, causing a panic.

    Set ccb_h.status = CAM_REQ_CMP at the top of the code rather than the
    bottom. Any future error paths will be right (since this command can't
    fail at the command level, just in the status of the data level).

    PR:                     293899
    Assisted-By:            Claude Opus 4.6 (1M context)
    Sponsored by:           Netflix
    Reviewed by:            jhb
    Differential Revision:  https://reviews.freebsd.org/D56487

 sys/cam/cam_xpt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.