HomeFreeBSD

cam: Properly mask out the status bits to get completion code

Description

cam: Properly mask out the status bits to get completion code

ccb_h.status has two parts: the actual status and some addition bits to
indicate additional information. It must be masked before comparing
against completion codes. Add new inline function cam_ccb_success to
simplify this to test whether or not the request succeeded. Most of the
code already does this, but a few places don't (the rest likely should
be converted to use cam_ccb_status and/or cam_ccb_success, but that's
for another day). This caused at least one bug in recognizing devices
behind a SATA port multiplexer, though some of these checks were
fine with the special knowledge of the code paths involved.

PR: 270459
Sponsored by: Netflix
MFC After: 1 week (and maybe a EN requst)
Reviewed by: ken, mav
Differential Revision: https://reviews.freebsd.org/D39572

Details

Provenance
impAuthored on Apr 14 2023, 2:32 PM
Reviewer
ken
Differential Revision
D39572: cam: Properly mask out the status bits to get completion code
Parents
rG63ee747febbf: zfs: Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
Branches
Unknown
Tags
Unknown