From: "Josef Möllers" <josef.moellers@fujitsu-siemens.com>
To: Patrick Mansfield <patmans@us.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: REPORT LUNS
Date: Tue, 24 Jun 2003 08:51:33 +0200 [thread overview]
Message-ID: <3EF7F4F5.F43CDC5@fujitsu-siemens.com> (raw)
In-Reply-To: 20030623094949.A7705@beaverton.ibm.com
Patrick Mansfield wrote:
>
> On Mon, Jun 16, 2003 at 08:55:18AM +0200, Josef Möllers wrote:
> > Patrick Mansfield wrote:
> > >
> > > 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.
> >
> > The comment said that the upper two bits were ignored which they were
> > not in the original code, so, apart from fixing the shifts, I also added
> > the mask to keep the code in sync with the comment. I haven't yet
> > followed the use of the value thus created.
>
> Ignored meaning "does nothing with it", when we should probably do
> something - proper conversion, an error or warning output. The current
> code might work (with high bits set), if we did not exceed the
> host->max_lun. We might need an 8 byte lun everywhere to make it work
> right for all cases.
OK.
> Can you give more details of the problem you are seeing, and software
> (adapter driver) and hardware in use?
The main problem we have is with current 2.4 kernels that some RAID
systems report SCSI-2 but allow for more than 8 LUNs, so rather than put
each box into the device_list[] (BLIST_SPARSELUN), I was investigating
how this problem could be solved in an orderly fashion: either by using
REPORT LUNS or by examining the Peripheral Qualifier in the INQUIRY data
(which would require BLIST_SPARSELUN, nonetheless).
I looked at the 2.5 code and found that REPORT LUNS was implemented but
stumbled across the comment. I couln't really make sense out of SCSI-3
and a manual I have for EMC RAID subsystems on the data returned by the
REPORT LUNS command. I then looked at the code, got confused about the
shifts and broke the code with my patch.
> I did not notice your shift changes - I don't see how they work or what
> it fixes.
Looking at it fresh in the morning: no, it doesn't fix anything, it
breaks code which is OK. I learnt my lesson to be more careful.
> If scsi_lun was: 0x1 0x2 0x3 0x4 0 0 0 0
>
> Current code:
>
> First loop in scsilun_to_int, with i = 0:
>
> lun = 0 | ( (0x1 << 8 | 0x2) << 0) = 0x0102
>
> Second loop i = 2:
>
> lun = 0x0102 | ( (0x3 << 8 | 0x4) << 16) = 0x03040102
>
> Your patch would give:
>
> First loop i = 0:
>
> lun = 0 | ((0x1 & 0x3f) << 1) | (0x2 << 0) = 0x02
>
> Second loop i = 2:
>
> lun = 0x02 | ( ((0x3 & 0x3f) << 17) | (0x4 << 16) = 0x00060002
You're absolutely right. If i needed an excuse (other than not having
been careful enough), I'd attribute it to the heat.
I'll test my patches more thoroughly in the future.
Sorry,
Josef
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
-
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-24 6:37 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
2003-06-16 6:55 ` Josef Möllers
2003-06-23 16:49 ` Patrick Mansfield
2003-06-24 6:51 ` Josef Möllers [this message]
-- 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=3EF7F4F5.F43CDC5@fujitsu-siemens.com \
--to=josef.moellers@fujitsu-siemens.com \
--cc=linux-scsi@vger.kernel.org \
--cc=patmans@us.ibm.com \
/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