All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Douglas Gilbert <dougg@torque.net>, linux-scsi@vger.kernel.org
Subject: Re: request sense
Date: Fri, 25 Feb 2005 08:58:28 -0800	[thread overview]
Message-ID: <20050225165828.GA8539@us.ibm.com> (raw)
In-Reply-To: <20050225153750.GU28741@parcelfarce.linux.theplanet.co.uk>

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

      reply	other threads:[~2005-02-25 16:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-24 23:19 request sense Matthew Wilcox
2005-02-25  4:02 ` Douglas Gilbert
2005-02-25 15:37   ` Matthew Wilcox
2005-02-25 16:58     ` Patrick Mansfield [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050225165828.GA8539@us.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.