All of lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 16 Jun 2003 08:55:18 +0200	[thread overview]
Message-ID: <3EED69D6.BDB411F7@fujitsu-siemens.com> (raw)
In-Reply-To: 20030613112222.A23260@beaverton.ibm.com

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.

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

It does so, iff sizeof(lun) is 4 and sizeof(struct scsi_lun) is 8.
Perhaps it was more a question of personal taste to change the code so
that it also works for 64 bit ints.

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

  reply	other threads:[~2003-06-16  6:41 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 [this message]
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=3EED69D6.BDB411F7@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 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.