public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* REPORT LUNS
@ 2003-06-13 14:04 Josef Möllers
  2003-06-13 18:22 ` Patrick Mansfield
  0 siblings, 1 reply; 7+ messages in thread
From: Josef Möllers @ 2003-06-13 14:04 UTC (permalink / raw)
  To: linux-scsi

[-- 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;
 
 			/*


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Apple Xserve RAID and qlogic ISP2312 (qla2300)
@ 2004-10-28 14:37 Patrick Mansfield
  2004-10-28 15:35 ` Catalin Muresan
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Mansfield @ 2004-10-28 14:37 UTC (permalink / raw)
  To: Catalin Muresan; +Cc: linux-scsi, bogdan.luca

On Thu, Oct 28, 2004 at 02:33:21AM +0300, Catalin Muresan wrote:
> 
> 	Hi,
> 
> 	I have the hardware from the subject, the problem i have is that the
> scsi layer doesn't see any luns i made on the raid except LUN 0. here is an
> example:

LUN 0 didn't show up according to your log output and comments below.

> [root@zerg-b root]# cd /proc/scsi/qla2xxx/  
> [root@zerg-b qla2xxx]# cat 0
> QLogic PCI to Fibre Channel Host Adapter for IBM HS20:
>         Firmware version 3.02.30 IPX, Driver version 8.00.00b15-k

> SCSI Device Information:
> scsi-qla0-adapter-node=2000000d60d367e0;
> scsi-qla0-adapter-port=2100000d60d367e0;
> scsi-qla0-target-0=60003930000026b4;
> 
> SCSI LUN Information:
> (Id:Lun)  * - indicates lun is not registered with the OS.
> ( 0: 5): Total reqs 0, Pending reqs 0, flags 0x0*, 0:0:83 00

The adapter seems to think there is a target and lun 0.

Did anything show up on host 1?

> 	you can see that the driver has found the 5th LUN but scsi_scan
> doesn't se it when scanning, scsi_probe_and_add_lun for LUN 0 returns
> SCSI_SCAN_NO_RESPONSE instead of SCSI_SCAN_TARGET_PRESENT. I have added
> {"APPLE", "Xserve RAID", NULL, BLIST_SPARSELUN}, in scsi_devinfo.c so
> scsi_scan will try and perform a sparse scan on the LUNs but that doesn't
> help because scanning LUN 0 fails.

Yep.

> Oct 28 01:59:37 zerg-b kernel: scsi_scan_host_selected: <0:4294967295:4294967295:4294967295>
> Oct 28 01:59:37 zerg-b kernel: scsi scan: INQUIRY to host 0 channel 0 id 0 lun 0
> Oct 28 01:59:37 zerg-b kernel: scsi scan: 1st INQUIRY failed with code 0x10000

The 0x10000 is a DID_NO_CONNECT, generally the adapter can't talk to
the target at all.

It seem like the storage was seen, then went away and then came back.

Do you always get the same behaviour?

Are there other messages in your log? Just post the entire log without
the scsi logging on, from adapter load time to scan completion.

> 	storage is APPLE Xserve RAID, latest firmware with lun masking activated, for this node
> the 5th LUN is allowed. using add-single-device does the trick but i need a
> kernel to boot from FC. here is the output after 

> # echo "scsi add-single-device 0 0 0 5" > /proc/scsi/scsi

You can also use:

	echo "- - -" > /sys/class/scsi_host/host0/scan

-- Patrick Mansfield

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-10 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox