Re: TYPE_RBC cache fixes (sbp2.c affected)

Douglas Gilbert
2005-05-22T05:08:06Z

Douglas Gilbert wrote:
> James Bottomley wrote:
>
>> On Sat, 2005-05-21 at 17:22 +0100, Al Viro wrote:
>>
>>> Tell that to firmware authors, why don't you?
>>
>>
>>
>> I do ... but they don't listen ...
>>
>>
>>>> Does anyone actually have one of these RBC devices and does it reject
>>>> the six byte mode sense commands?
>>>
>>>
>>> Yes, will check and do not expect the results to apply to other
>>> devices...
>>
>>
>>
>> Thanks ... I'd be surprised if the entire class of RBC devices simply
>> ignored the standard; I wouldn't be surprised to find one or two that
>> are out of spec.
>>
>> James
>
> James,
> Perhaps __scsi_mode_sense() could do a simple sanity
> check: for any valid mode page [after the header and
> block descriptor(s) are stepped over]:
> ((mpage[0] & 3f) == page_num)
>
> If a response fails that test, we don't believe it.

A bit more accurate sanity check:
if ((page_num > 0) && (page_num < 0x3f) &&
((mpage[0] & 3f) == page_num))
// page looks ok (even if subpage_num was 0xff)
else
// nah

Mode page number 0 is the unit attention vendor specific
page which is not necessarily in "mode page format".
The vendor that I know does use it, does at least follow
mode page format.
A requested page_num of 0x3f and a requested subpage_num
of 0xff are wildcards.

Doug Gilbert

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!