]>
Commit | Line | Data |
---|---|---|
dcf4d15d GKH |
1 | From 305c2e71b3d733ec065cb716c76af7d554bd5571 Mon Sep 17 00:00:00 2001 |
2 | From: Johannes Thumshirn <jthumshirn@suse.de> | |
3 | Date: Tue, 5 Apr 2016 11:50:45 +0200 | |
4 | Subject: Revert "scsi: fix soft lockup in scsi_remove_target() on module removal" | |
5 | ||
6 | From: Johannes Thumshirn <jthumshirn@suse.de> | |
7 | ||
8 | commit 305c2e71b3d733ec065cb716c76af7d554bd5571 upstream. | |
9 | ||
10 | Now that we've done a more comprehensive fix with the intermediate | |
11 | target state we can remove the previous hack introduced with commit | |
12 | 90a88d6ef88e ("scsi: fix soft lockup in scsi_remove_target() on module | |
13 | removal"). | |
14 | ||
15 | Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> | |
16 | Reviewed-by: Ewan D. Milne <emilne@redhat.com> | |
17 | Reviewed-by: Hannes Reinecke <hare@suse.com> | |
18 | Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
20 | ||
21 | --- | |
22 | drivers/scsi/scsi_sysfs.c | 6 ++---- | |
23 | 1 file changed, 2 insertions(+), 4 deletions(-) | |
24 | ||
25 | --- a/drivers/scsi/scsi_sysfs.c | |
26 | +++ b/drivers/scsi/scsi_sysfs.c | |
27 | @@ -1366,19 +1366,17 @@ static void __scsi_remove_target(struct | |
28 | void scsi_remove_target(struct device *dev) | |
29 | { | |
30 | struct Scsi_Host *shost = dev_to_shost(dev->parent); | |
31 | - struct scsi_target *starget, *last_target = NULL; | |
32 | + struct scsi_target *starget; | |
33 | unsigned long flags; | |
34 | ||
35 | restart: | |
36 | spin_lock_irqsave(shost->host_lock, flags); | |
37 | list_for_each_entry(starget, &shost->__targets, siblings) { | |
38 | if (starget->state == STARGET_DEL || | |
39 | - starget->state == STARGET_REMOVE || | |
40 | - starget == last_target) | |
41 | + starget->state == STARGET_REMOVE) | |
42 | continue; | |
43 | if (starget->dev.parent == dev || &starget->dev == dev) { | |
44 | kref_get(&starget->reap_ref); | |
45 | - last_target = starget; | |
46 | starget->state = STARGET_REMOVE; | |
47 | spin_unlock_irqrestore(shost->host_lock, flags); | |
48 | __scsi_remove_target(starget); |