]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy
Move xen patchset to new version's subdir.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / scsi-scan-set-SDEV_DEL-on-destroy
diff --git a/src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy b/src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy
new file mode 100644 (file)
index 0000000..68e8cb9
--- /dev/null
@@ -0,0 +1,28 @@
+From: James Smart <james.smart@emulex.com>
+Subject: add missing interim SDEV_DEL state if slave_alloc fails
+References: bnc#468640
+
+We were running i/o and performing a bunch of hba resets in a loop.
+This forces a lot of target removes and then rescans. Since the
+resets are occuring during scan it's causing the scan i/o to timeout,
+invoking error recovery, etc.  We end up getting some nasty crashing
+in scsi_scan.c due to references to old sdevs that are failing
+but had some lingering references that kept them around.
+
+Fix by setting device state to SDEV_DEL if the LLD's slave_alloc
+fails.
+
+Signed-off-by: Hannes Reinecke <hare@suse.de>
+
+diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
+index e5777e6..262a7ea 100644
+--- a/drivers/scsi/scsi_scan.c
++++ b/drivers/scsi/scsi_scan.c
+@@ -314,6 +314,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
+       return sdev;
+ out_device_destroy:
++      scsi_device_set_state(sdev, SDEV_DEL);
+       transport_destroy_device(&sdev->sdev_gendev);
+       put_device(&sdev->sdev_gendev);
+ out: