All of lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 23 Jun 2003 09:49:49 -0700	[thread overview]
Message-ID: <20030623094949.A7705@beaverton.ibm.com> (raw)
In-Reply-To: <3EED69D6.BDB411F7@fujitsu-siemens.com>; from josef.moellers@fujitsu-siemens.com on Mon, Jun 16, 2003 at 08:55:18AM +0200

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.

Can you give more details of the problem you are seeing, and software
(adapter driver) and hardware in use?

I did not notice your shift changes - I don't see how they work or what
it fixes.

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

-- 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

  reply	other threads:[~2003-06-23 16:39 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 [this message]
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=20030623094949.A7705@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 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.