RE: [usb-storage] Re: PATCH: exclude certain commands from emulated SCSI hosts

Pat LaVarre
2003-03-24T18:17:56Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2604 bytes --]

> For sd, we gauge the size of the command from the
> size of the medium: <1Gb=> six byte, from 1Gb to
> 2Tb 10 byte, over 2Tb 16 byte

By now this theory we have completely disavowed?

I haven't seen our English yet mention that asking to
read/write more than xFF blocks triggers us to skip
past the commonly misunderstood x08/0A
Read(6)/Write(6) standard of using x00 to mean x100.

I think instead we resort immediately to x28/2A
Read(10)/Write(10).

In http://lxr.linux.no/source/drivers/scsi/sd.c?v=2.5.56
I see fragments that match our later English:

SRpnt->sr_device->ten = 1;

if (block > 0xffffffff) {
SCpnt->cmnd[0] += READ_16 - READ_6;
...
if (((this_count > 0xff) || (block > 0x1fffff)) || SCpnt->device->ten) {
...
SCpnt->cmnd[0] += READ_10 - READ_6;

case ILLEGAL_REQUEST:
if (SCpnt->device->ten == 1) {
if (SCpnt->cmnd[0] == READ_10 ||
SCpnt->cmnd[0] == WRITE_10)
SCpnt->device->ten = 0;
}

Being a dramatically raw Linux newbie, I can't know if
sequencing this code to match the English is correct
or not, nor indeed if I am reading the source file we mean.

Click-thru ILLEGAL_REQUEST shows me three source files
agree with me thinking by that jargon we mean x05.
And more or less source files agree that by READ_6
READ_10 WRITE_10 we mean x 08 0A 2A.

Cluelessly, curiously, thankfully yours, Pat LaVarre

-----Original Message-----
From: James Bottomley [mailto:James.Bottomley@SteelEye.com]
Sent: Mon 3/24/2003 9:56 AM
To: Jens Axboe
Cc: Linus Torvalds; Matthew Dharm; USB Developers; USB Storage List; Linux SCSI list
Subject: [usb-storage] Re: PATCH: exclude certain commands from emulated SCSI hosts

On Mon, 2003-03-24 at 10:52, Jens Axboe wrote:
> It's not true, ->ten is set unconditionally and we only fall back to 6
> byte cdb's if we see an ILLEGAL_REQUEST on a READ_10/WRITE_10.
>
> So the logic is, always assume 10-byte commands. If an incoming request
> cannot be addressed with 10-byte commands, use 16.

Sorry, that was me misreading the fallback logic in sd.c

Ten bytes it is unless we have problems.

James

_______________________________________________
usb-storage mailing list
usb-storage@one-eyed-alien.net
http://www2.one-eyed-alien.net/mailman/listinfo/usb-storage

N\x18¬±ùÞµéšŠX¬²š'²ŠÞu¼“†)ä\x19ç¤Yé\¢g­¢\až’\x17š½éá¶Ú\x7fþØbžH\x1ezG(›û\x1f–)îÆë^[uëÞ–X¬¶Ë(º·\x1e~Šàzw­N‹§²æìr¸›zë\x1e¶\x17¥jË_¢¹Ÿ‰é]jØm¶›?þX¬¶Ë(º·\x1e~Šàzw­þX¬¶ÏåŠËbú?–)îÆë^[uëÞ