Doug, > I think scsi_mode_sense() needs looking at. It says this in its header: > > * @dbd: set if mode sense will allow block descriptors to be returned Yeah, that's also broken. > which is a worry when you consider that DBD bit means "DISABLE block > descriptors" [spc6r01.pdf chapter 6.14.1]. If the caller wants block > descriptors (i.e. dbd=0 (or false)) then they really should set the > LLBA bit or they will be truncating any LBAs (in the returned block > descriptors) greater than 2**32-1 to the lower 32 bits. However only > the MODE SENSE(10) command has the LLBA bit. So if MODE SENSE(10) > fails and you leave the LLBA bit set and switch to MODE SENSE(6) then > the device server is within its rights to say: WTF is bit 4 in > byte 1 set? Hence ==> illegal request. I agree. I simply zapped it because none of the callers of scsi_mode_sense() actually set LLBAA, nor did any of them care about the block descriptors. I think it's mostly a historical artifact that some callers request the descriptors. But the concern is obviously what blows up if we suddenly start setting DBD flag while querying the Caching Mode Page on the usual suspects in the USB department. > That function is just badly designed and does not allow for subpages. > Can it be thrown out? Given the very limited use inside the kernel it didn't seem worth the hassle/risk to make it a full fledged MODE SENSE implementation. But I am happy to entertain cleanups in this department. I was really just trying to silence a warning. -- Martin K. Petersen Oracle Linux Engineering