Page MenuHomeFreeBSD

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

Authored by imp on Fri, Apr 17, 10:35 PM.
Tags
None
Referenced Files
F153827081: D56487.diff
Fri, Apr 24, 1:43 AM
Unknown Object (File)
Wed, Apr 22, 4:26 PM
Unknown Object (File)
Tue, Apr 21, 1:06 PM
Unknown Object (File)
Tue, Apr 21, 12:02 PM
Unknown Object (File)
Tue, Apr 21, 1:09 AM
Unknown Object (File)
Sun, Apr 19, 7:00 PM
Unknown Object (File)
Sat, Apr 18, 5:13 AM
Unknown Object (File)
Sat, Apr 18, 4:37 AM
Subscribers
None

Details

Reviewers
jhb
mav
ken
chs
Group Reviewers
cam
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