From: Patrick Mansfield <patmans@us.ibm.com>
To: "Josef Möllers" <josef.moellers@fujitsu-siemens.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: REPORT LUNS
Date: Fri, 13 Jun 2003 11:22:22 -0700 [thread overview]
Message-ID: <20030613112222.A23260@beaverton.ibm.com> (raw)
In-Reply-To: <3EE9DA00.A429F83F@fujitsu-siemens.com>; from josef.moellers@fujitsu-siemens.com on Fri, Jun 13, 2003 at 04:04:48PM +0200
On Fri, Jun 13, 2003 at 04:04:48PM +0200, Josef Möllers wrote:
> Hi,
>
> Wile trying to figure out how to ignore non-existing LUNs on RAID
> devices, I have fallen across an error in scsilun_to_int() where it
> doesn't behave as the comment suggests and a problematic piece of code
> in scsi_report_lun_scan().
>
> Patch is included.
If we clear the upper bits (address method, per SAM-3), someone has to
eventually set them again, and this is not handled today in linux scsi
core.
What adapter and driver are you using? AFAIK the Emulex driver figures out
the address method (high two bits) and ors it with each LUN sent down.
I don't recall what happens with the qlogic driver, I thought it had some
special code to handle these, but can't find it.
For SPI it seems OK to ignore the upper bits since they are truncated.
Maybe some devices work OK this way - they set an address method of 10b or
01b, and then don't care that the LUN comes in without the high bits set.
So the change might work for some adapters, but break on others.
We are probably broken for anyone using the 11b extended logical unit
addressing method (with or without your patch).
Can you change your RAID device to use the peripheral device addressing
method - address method of 00b - instead?
In any case we should do what actually works, given that we are
translating an 8 byte LUN to a (host ordered) int, and later converting
that back to an 8 or 1 byte LUN (for qlogic, to a 2 byte LUN that is then
converted to an 8 byte LUN).
> @@ -1027,13 +1027,18 @@
> * the header, so start at 1 and go up to and including num_luns.
> */
> for (lunp = &lun_data[1]; lunp <= &lun_data[num_luns]; lunp++) {
> + int j;
> +
> lun = scsilun_to_int(lunp);
>
> /*
> * Check if the unused part of lunp is non-zero, and so
> * does not fit in lun.
> */
> - if (memcmp(&lunp->scsi_lun[sizeof(lun)], "\0\0\0\0", 4)) {
> + for (j = sizeof(lun); j < sizeof(struct scsi_lun); j++)
> + if (lunp->scsi_lun[j] != 0)
> + break;
> + if (j < sizeof(struct scsi_lun)) {
> int i;
>
> /*
What does the above patch fix? It looks like they both check if the last
four bytes are 0.
PS: Going offline really soon now for about a week.
-- Patrick Mansfield
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2003-06-13 18:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-13 14:04 REPORT LUNS Josef Möllers
2003-06-13 18:22 ` Patrick Mansfield [this message]
2003-06-16 6:55 ` Josef Möllers
2003-06-23 16:49 ` Patrick Mansfield
2003-06-24 6:51 ` Josef Möllers
-- strict thread matches above, loose matches on Subject: below --
2004-10-28 14:37 Apple Xserve RAID and qlogic ISP2312 (qla2300) Patrick Mansfield
2004-10-28 15:35 ` Catalin Muresan
2004-10-28 16:42 ` Patrick Mansfield
2004-10-28 17:21 ` Andrew Vasquez
2004-10-29 8:58 ` Catalin Muresan
2004-10-29 18:06 ` Patrick Mansfield
2004-11-01 10:56 ` Catalin Muresan
2004-11-01 19:48 ` Patrick Mansfield
2004-11-09 2:49 ` Report luns [was: Apple Xserve RAID and qlogic ISP2312 (qla2300)] Douglas Gilbert
2004-11-09 15:06 ` Luben Tuikov
2004-11-09 21:10 ` Patrick Mansfield
2004-11-10 4:47 ` Report luns Douglas Gilbert
2004-11-10 14:13 ` Luben Tuikov
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=20030613112222.A23260@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=josef.moellers@fujitsu-siemens.com \
--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