From: bugzilla-daemon@bugzilla.kernel.org
To: linux-scsi@vger.kernel.org
Subject: [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN
Date: Mon, 25 Aug 2014 20:12:49 +0000 [thread overview]
Message-ID: <bug-80711-11613-aBrbCTHibI@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-80711-11613@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=80711
--- Comment #19 from Alan Stern <stern@rowland.harvard.edu> ---
On Mon, 25 Aug 2014, James Bottomley wrote:
> On Mon, 2014-08-25 at 10:44 -0400, Alan Stern wrote:
>
> > James, can you explain how the INQUIRY command in scsi_probe_lun()
> > managed to work back in the days when multi-lun SCSI-2 devices were
> > common? sdev->scsi_level doesn't get set when sdev is allocated, so it
> > initially contains 0, so the LUN bits won't get filled in when the
> > first INQUIRY command is sent. Then how could the target know which
> > logical unit the INQUIRY was meant for?
>
> Best guess, some patches over the course of time altered the way we do
> this and no-one noticed. I think it was probably the introduction of
> the unknown SCSI data level that caused the breakage.
Heh. The change was made by commit 4d7db04a7a69 ([SCSI] add
SCSI_UNKNOWN and LUN transfer limit restrictions) back in 2006 -- the
2.6.17 kernel. If nobody has complained in all this time then it's
probably not worth changing.
> Historically, the LUN in CMD bits is left over from SCSI-1; it was
> incorporated into SCSI-2 for backward compatibility (even though SCSI-2
> moved the LUN specification to the identify message). In SCSI-3 and
> beyond, those bits were obsoleted and transports took sole
> responsibility for LUN handling. I'm fairly certain all the SCSI-1
> devices relying on this behaviour have long ago migrated to the great
> data centre in the sky.
>
> Alan's fix looks reasonable because we probe LUN 0 first (for SCSI-1 and
> 2 which has parallel scanning), which is why it doesn't matter (the bits
> are set to zero) and once we have LUN 0 we propagate the data to the
> target and make it the basis for future checks. I'd like to see a
> comment explaining this in the code, though ...
If you think it would be a good idea, I could put it into a separate
patch with an explanatory comment. At the moment, I'm inclined to
forget about it.
Alan Stern
--
You are receiving this mail because:
You are the assignee for the bug.
next prev parent reply other threads:[~2014-08-25 20:12 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-20 0:37 [Bug 80711] New: SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN bugzilla-daemon
2014-07-20 14:13 ` [Bug 80711] " bugzilla-daemon
2014-07-21 9:05 ` bugzilla-daemon
2014-07-22 16:13 ` Christoph Hellwig
2014-07-29 15:57 ` [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT " bugzilla-daemon
2014-08-06 13:29 ` Douglas Gilbert
2014-08-06 19:32 ` Christoph Hellwig
2014-08-06 20:02 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1408061545030.1145-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-08-06 20:25 ` Alan Stern
2014-08-07 6:39 ` Christoph Hellwig
2014-08-07 15:58 ` Alan Stern
2014-08-19 17:56 ` Christoph Hellwig
2014-08-20 19:15 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1408201507280.1959-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-08-21 14:41 ` Douglas Gilbert
2014-08-21 14:42 ` Christoph Hellwig
2014-08-21 17:31 ` Alan Stern
2014-08-21 21:43 ` Martin K. Petersen
2014-08-21 21:57 ` Christoph Hellwig
[not found] ` <20140821215744.GA29651-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-08-22 14:53 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1408221044450.967-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-08-22 15:05 ` Christoph Hellwig
[not found] ` <20140822150508.GA1321-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-08-22 15:26 ` Alan Stern
2014-08-22 15:08 ` Martin K. Petersen
2014-08-22 15:39 ` James Bottomley
2014-08-22 17:29 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1408221249360.967-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-08-24 15:04 ` Christoph Hellwig
2014-08-25 14:44 ` Alan Stern
2014-08-25 19:39 ` James Bottomley
[not found] ` <1408995547.3629.7.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2014-08-25 20:12 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1408251545580.1385-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-08-25 21:19 ` Alan Stern
2014-08-25 21:30 ` James Bottomley
2014-08-06 13:37 ` bugzilla-daemon
2014-08-06 20:09 ` bugzilla-daemon
2014-08-06 20:25 ` bugzilla-daemon
2014-08-06 21:16 ` bugzilla-daemon
2014-08-07 15:58 ` bugzilla-daemon
2014-08-07 16:10 ` bugzilla-daemon
2014-08-20 19:15 ` bugzilla-daemon
2014-08-21 14:41 ` bugzilla-daemon
2014-08-21 17:31 ` bugzilla-daemon
2014-08-21 21:43 ` bugzilla-daemon
2014-08-22 14:53 ` bugzilla-daemon
2014-08-22 15:08 ` bugzilla-daemon
2014-08-22 15:26 ` bugzilla-daemon
2014-08-22 17:29 ` bugzilla-daemon
2014-08-25 14:44 ` bugzilla-daemon
2014-08-25 20:12 ` bugzilla-daemon [this message]
2014-08-25 21:19 ` bugzilla-daemon
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=bug-80711-11613-aBrbCTHibI@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox