Page MenuHomeFreeBSD

Make cam_getccb(3) zero the whole ccb, not just the header
ClosedPublic

Authored by trasz on Nov 23 2020, 1:33 PM.
Tags
None
Referenced Files
F163374905: D27333.id81291.diff
Wed, Jul 22, 3:33 PM
F163365385: D27333.id.diff
Wed, Jul 22, 1:26 PM
Unknown Object (File)
Tue, Jul 21, 12:44 AM
Unknown Object (File)
Sun, Jul 19, 4:56 PM
Unknown Object (File)
Thu, Jul 2, 7:22 AM
Unknown Object (File)
Mon, Jun 29, 10:13 PM
Unknown Object (File)
Jun 18 2026, 10:47 PM
Unknown Object (File)
Jun 18 2026, 10:06 AM
Subscribers

Details

Summary

Make cam_getccb(3) zero the whole ccb, not just the header.

Leaving zeroing to the clients leads to error-prone pointer
tricks (zeroing needs to preserve the CCB header), and this
code is not performance-critical, so there's really no reason
to not do it.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 34975
Build 31968: arc lint + arc unit

Event Timeline

trasz requested review of this revision.Nov 23 2020, 1:33 PM
rpokala added a subscriber: rpokala.

LGTM, but I'm not authoritative when it comes to CAM.

I believe this is a good change. There's no performance reason to avoid zeroing, and in the kernel we do this:

new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_ZERO|M_WAITOK);

so this makes code that runs in both places more similar.

This revision is now accepted and ready to land.Nov 23 2020, 7:12 PM