]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/scsi-scan-set-SDEV_DEL-on-destroy
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / scsi-scan-set-SDEV_DEL-on-destroy
1 From: James Smart <james.smart@emulex.com>
2 Subject: add missing interim SDEV_DEL state if slave_alloc fails
3 References: bnc#468640
4
5 We were running i/o and performing a bunch of hba resets in a loop.
6 This forces a lot of target removes and then rescans. Since the
7 resets are occuring during scan it's causing the scan i/o to timeout,
8 invoking error recovery, etc. We end up getting some nasty crashing
9 in scsi_scan.c due to references to old sdevs that are failing
10 but had some lingering references that kept them around.
11
12 Fix by setting device state to SDEV_DEL if the LLD's slave_alloc
13 fails.
14
15 Signed-off-by: Hannes Reinecke <hare@suse.de>
16
17 diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
18 index 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: