]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / scsi-scan-set-SDEV_DEL-on-destroy
CommitLineData
2cb7cef9
BS
1From: James Smart <james.smart@emulex.com>
2Subject: add missing interim SDEV_DEL state if slave_alloc fails
3References: bnc#468640
4
5We were running i/o and performing a bunch of hba resets in a loop.
6This forces a lot of target removes and then rescans. Since the
7resets are occuring during scan it's causing the scan i/o to timeout,
8invoking error recovery, etc. We end up getting some nasty crashing
9in scsi_scan.c due to references to old sdevs that are failing
10but had some lingering references that kept them around.
11
12Fix by setting device state to SDEV_DEL if the LLD's slave_alloc
13fails.
14
15Signed-off-by: Hannes Reinecke <hare@suse.de>
16
17diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
18index e5777e6..262a7ea 100644
19--- a/drivers/scsi/scsi_scan.c
20+++ b/drivers/scsi/scsi_scan.c
21@@ -314,6 +314,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
22 return sdev;
23
24 out_device_destroy:
25+ scsi_device_set_state(sdev, SDEV_DEL);
26 transport_destroy_device(&sdev->sdev_gendev);
27 put_device(&sdev->sdev_gendev);
28 out: