On Fri, Feb 25, 2005 at 03:37:50PM +0000, Matthew Wilcox wrote:
> On Fri, Feb 25, 2005 at 02:02:20PM +1000, Douglas Gilbert wrote:

> > Back in SCSI-2 (final t10 draft in 1993, standard in 1994) all
> > SCSI commands (I believe) used the top 3 bits of byte 1 of a cdb
> > for the logical unit number (lun). In those days SCSI had only
> > one transport (now called SPI) and luns were limited to 8 (3 bits)
> > for each target.
> > 
> > By SPC (part of the original "SCSI-3") those 3 bits were reserved
> > and luns had increased to 32 bits and were conveyed across the
> > SCSI transport by soem other mechanism (i.e. not the cdb). SPC was
> > standardized in 1997 and the final draft is dated almost 8 years
> > ago.
> 
> Thanks for the extremely clear explanation.  I suppose the effect of this
> bug is pretty minimal -- it only affects multi-lun scsi-2 devices, and even
> with those, it simply gets the sense data from the wrong LUN.  

I assume you mean _potentially_ affects affects only multi-lun scsi-2
earlier devices?

> That argues in favour of having scsi_error's implementation set the lun
> bits, conditional on sdev->scsi_level, right?

It already does so for all commands, see scsi_send_eh_cmnd():

        if (scmd->device->scsi_level <= SCSI_2)
                scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
                (scmd->device->lun << 5 & 0xe0);

And scsi_dispatch_cmd() has the same code for the normal IO paths.

-- Patrick Mansfield
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to