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
Unknown Object (File)
Fri, Nov 15, 9:42 PM
Unknown Object (File)
Fri, Nov 15, 7:14 PM
Unknown Object (File)
Sun, Nov 3, 5:06 PM
Unknown Object (File)
Oct 17 2024, 10:46 PM
Unknown Object (File)
Sep 23 2024, 3:18 AM
Unknown Object (File)
Sep 22 2024, 7:36 PM
Unknown Object (File)
Sep 21 2024, 4:50 AM
Unknown Object (File)
Sep 10 2024, 1:07 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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