Page MenuHomeFreeBSD

cam: Zero bio pointer in user-supplied SCSI CCBs
ClosedPublic

Authored by cem on Nov 8 2016, 8:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 16 2024, 5:53 AM
Unknown Object (File)
Oct 14 2024, 9:00 AM
Unknown Object (File)
Sep 30 2024, 11:20 PM
Unknown Object (File)
Sep 23 2024, 2:07 AM
Unknown Object (File)
Sep 22 2024, 6:04 PM
Unknown Object (File)
Sep 21 2024, 4:48 PM
Unknown Object (File)
Sep 21 2024, 4:02 PM
Unknown Object (File)
Sep 18 2024, 1:25 PM
Subscribers
None

Details

Summary

The BUF_TRACKING bio pointer only makes sense for kernel consumers of CCBs.

PR: 214250
Reported by: trasz@

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem retitled this revision from to cam: Zero bio pointer in user-supplied SCSI CCBs The BUF_TRACKING bio pointer only makes sense for kernel consumers of CCBs..
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added reviewers: trasz, imp, scottl, markj.
cem retitled this revision from cam: Zero bio pointer in user-supplied SCSI CCBs The BUF_TRACKING bio pointer only makes sense for kernel consumers of CCBs. to cam: Zero bio pointer in user-supplied SCSI CCBs.Nov 8 2016, 8:17 PM
cem updated this object.
imp edited edge metadata.

Though I wonder why only the SCSI_IOs?

This revision is now accepted and ready to land.Nov 8 2016, 8:20 PM
sys/cam/cam_xpt.c
418 ↗(On Diff #22096)

Why not do this for all CCBs?

In D8477#176243, @imp wrote:

Though I wonder why only the SCSI_IOs?

That's just all we added the tracking to in r308155. It could be made more generic by a motivated person :-).

sys/cam/cam_xpt.c
418 ↗(On Diff #22096)

Only XPT_SCSI_IO CCBs have valid inccb->csio members. For other CCBs that would scribble some random struct member.

markj edited edge metadata.
sys/cam/cam_xpt.c
418 ↗(On Diff #22096)

What about XPT_ATA_IO? I guess this is a question more for the previous commit; it looks like XPT_ATA_IO was omitted from that too. Next question, since i wasn't on the review for the original commit, is why can't this be done with dtrace?

sys/cam/cam_xpt.c
418 ↗(On Diff #22096)

What about XPT_ATA_IO? I guess this is a question more for the previous commit; it looks like XPT_ATA_IO was omitted from that too.

Yeah. Same answer as to Warner — we were only interested in SCSI. No reason it has to be exclusive to SCSI CCBs, though.

Next question, since i wasn't on the review for the original commit, is why can't this be done with dtrace?

I'm not sure it can be done in dtrace — the main utility of this tracking is for debugging panics. Can you access dtrace state from a panic or core? Even if you can, the overhead of dtrace is likely significantly higher.

This revision was automatically updated to reflect the committed changes.