Bug fix for scsi.d
By user12625760 on Mar 14, 2007
Today, well last night, I learned that dtrace clause local variables (this->) unlike thread local variables (self->) are not initialised by default. This is all clearly stated in the documentation had I read it with more care. My thanks to Adam on the OpenSoalris zfs-discuss alias for pointing it out to me. The long and the short of this means that when I changed scsi.d to use clause local variables I needed to also ensure that they were initialised before testing them.
While I was editing it I also added support for Group 6 and 7 SCSI commands. Since these commands are vendor specific it just prints out the first 32 bytes of the CDB, or the whole CDB if it is less than 32 bytes. In the event that you need more than 32 bytes to be printed adding this is trivial. The section of code, with line numbers, that prints out bytes 25 to 32 is listed here:
554 PRINT_CDB(24) 555 PRINT_CDB(25) 556 PRINT_CDB(26) 557 PRINT_CDB(27) 558 PRINT_CDB(28) 559 PRINT_CDB(29) 560 PRINT_CDB(30) 561 PRINT_CDB(31)
There are no prizes for working out how to make it print byte 33.
So there is verson 1.11 of scsi.d.