Page MenuHomeFreeBSD

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

Authored by imp on Apr 17 2026, 10:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 25, 9:32 PM
Unknown Object (File)
Mon, May 25, 9:28 AM
Unknown Object (File)
Mon, May 25, 9:28 AM
Unknown Object (File)
Sun, May 24, 11:34 PM
Unknown Object (File)
Mon, May 18, 6:16 AM
Unknown Object (File)
Mon, May 18, 6:08 AM
Unknown Object (File)
Sun, May 17, 3:00 AM
Unknown Object (File)
Sun, May 17, 3:00 AM
Subscribers
None

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72308
Build 69191: arc lint + arc unit