Re: [PATCH v2] scsi: core: Make MODE SENSE DBD a boolean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux