public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Josef Möllers" <josef.moellers@fujitsu-siemens.com>
To: linux-scsi@vger.kernel.org
Subject: REPORT LUNS
Date: Fri, 13 Jun 2003 16:04:48 +0200	[thread overview]
Message-ID: <3EE9DA00.A429F83F@fujitsu-siemens.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

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.

-- 
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett

[-- Attachment #2: patch-2.5.70a --]
[-- Type: text/plain, Size: 996 bytes --]

--- linux-2.5.70/drivers/scsi/scsi_scan.c	2003-05-27 03:00:46.000000000 +0200
+++ linux-2.5.70a/drivers/scsi/scsi_scan.c	2003-06-13 15:54:22.000000000 +0200
@@ -884,8 +884,8 @@
 
 	lun = 0;
 	for (i = 0; i < sizeof(lun); i += 2)
-		lun = lun | (((scsilun->scsi_lun[i] << 8) |
-			      scsilun->scsi_lun[i + 1]) << (i * 8));
+		lun = lun | (((scsilun->scsi_lun[i] & 0x3f) << (i * 8 + 1)) |
+			      ((scsilun->scsi_lun[i + 1]) << (i * 8)));
 	return 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;
 
 			/*


             reply	other threads:[~2003-06-13 13:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-13 14:04 Josef Möllers [this message]
2003-06-13 18:22 ` REPORT LUNS 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
  -- 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=3EE9DA00.A429F83F@fujitsu-siemens.com \
    --to=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