Skip to contentSkip to conversation

EMC Symmetrix vs. no storage on LUN 0

PATCH Guido Guenther 2 participants 4 messages Apr 27, 2006 – May 3, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

Hi,
we have a rather old EMC Symmetrix which always has a peripheral qualifier of 001b on LUN0. This has the problem that the scsi_probe_and_add_lun code bails out to out_free_result: before we apply the device flags (that we got from scsi_probe_lun just before this check) to bflagsp. The result is that (without these flags) we stop scanning and don't see any devices on the EMC. This patch against 2.6.16 ignores this peripheral qualifier for LUN 0 and the devices get detected properly:

drivers/scsi/scsi_scan.c renamed from drivers/scsi/scsi_scan.c.orig +1 -1
@@ -853,7 +862,7 @@
 	/*
 	 * result contains valid SCSI INQUIRY data.
 	 */
-	if ((result[0] >> 5) == 3) {
+	if ((result[0] >> 5) == 3 && lun != 0) {
 		/*
 		 * For a Peripheral qualifier 3 (011b), the SCSI
 		 * spec says: The device server is not capable of

Historical note: we always had issues with this machine, we had a different patch for 2.6.11, discussion about it is here:
http://marc.theaimsgroup.com/?l=linux-scsi&m=110297733824960&w=2
Due to code changes in recent kernels we just need the above now, can this be applied?
Cheers,
-- Guido

#1 lore raw
Quoted 5 lines · Guido Guenther

we have a rather old EMC Symmetrix which always has a peripheral qualifier of 001b on LUN0. This has the problem that the scsi_probe_and_add_lun code bails out to out_free_result: before we apply the device flags (that we got from scsi_probe_lun just before this check) to bflagsp. The result is that (without these flags) we stop

[..snip..]
The previously attached patch has the issue that we add a device though not actually present just to safe the bflags. This version should do better:

drivers/scsi/scsi_scan.c renamed from linux-2.6.16.7/drivers/scsi/scsi_scan.c +6 -0
@@ -868,6 +868,12 @@ static int scsi_probe_and_add_lun(struct
 					"scsi scan: peripheral qualifier of 3,"
 					" no device added\n"));
 		res = SCSI_SCAN_TARGET_PRESENT;
+
+		/* don't discard the already fetched bflags for lun 0 so
+		 * __scsi_scan_target knows about them */
+		if (bflagsp && lun == 0)
+			*bflagsp = bflags;
+	   	
 		goto out_free_result;
 	}
 

Cheers,
-- Guido

#2 lore raw
Quoted 15 lines · Guido Guenther
Quoted 5 lines · Guido Guenther

we have a rather old EMC Symmetrix which always has a peripheral qualifier of 001b on LUN0. This has the problem that the scsi_probe_and_add_lun code bails out to out_free_result: before we apply the device flags (that we got from scsi_probe_lun just before this check) to bflagsp. The result is that (without these flags) we stop

[..snip..]
The previously attached patch has the issue that we add a device though not actually present just to safe the bflags. This version should do better:

drivers/scsi/scsi_scan.c renamed from linux-2.6.16.7/drivers/scsi/scsi_scan.c +0 -0
@@ -868,6 +868,12 @@ static int scsi_probe_and_add_lun(struct
 					"scsi scan: peripheral qualifier of 3,"

drivers/scsi/scsi_scan.c static int scsi_probe_and_add_lun(struct · line 878

Quoted 10 lines
drivers/scsi/scsi_scan.c renamed from linux-2.6.16.7/drivers/scsi/scsi_scan.c +6 -0
 					" no device added\n"));
 		res = SCSI_SCAN_TARGET_PRESENT;
+
+		/* don't discard the already fetched bflags for lun 0 so
+		 * __scsi_scan_target knows about them */
+		if (bflagsp && lun == 0)
+			*bflagsp = bflags;
+	   	
 		goto out_free_result;
 	}

A similar patch is already in scsi-misc and mm trees, you should test one of those.

Here is the patch from Kurt that was accepted into scsi-misc:

http://www.kernel.org/git/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=blobdiff;h=820c4ad7b5817e24550d50dd35ca740cd86de4fe;hp=f14945996ede5ec514bc0e390b506ffcfaa4d461;hb=4186ab1973758190916703eb8889ebe8002c5c8f;f=drivers/scsi/scsi_scan.c

-- Patrick Mansfield

#3 lore raw
Quoted 6 lines · Patrick Mansfield

A similar patch is already in scsi-misc and mm trees, you should test one of those.

Here is the patch from Kurt that was accepted into scsi-misc:

http://www.kernel.org/git/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=blobdiff;h=820c4ad7b5817e24550d50dd35ca740cd86de4fe;hp=f14945996ede5ec514bc0e390b506ffcfaa4d461;hb=4186ab1973758190916703eb8889ebe8002c5c8f;f=drivers/scsi/scsi_scan.c

Yes, seems that this is doing basically the same. Thanks!
-- Guido