Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "scsi: fix soft lockup in scsi_remove_target() on module removal"

Now that we've done a more comprehensive fix with the intermediate
target state we can remove the previous hack introduced with commit
90a88d6ef88e ("scsi: fix soft lockup in scsi_remove_target() on module
removal").

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: stable@vger.kernel.org
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Johannes Thumshirn and committed by
Martin K. Petersen
305c2e71 f05795d3

+2 -4
+2 -4
drivers/scsi/scsi_sysfs.c
··· 1367 1367 void scsi_remove_target(struct device *dev) 1368 1368 { 1369 1369 struct Scsi_Host *shost = dev_to_shost(dev->parent); 1370 - struct scsi_target *starget, *last_target = NULL; 1370 + struct scsi_target *starget; 1371 1371 unsigned long flags; 1372 1372 1373 1373 restart: 1374 1374 spin_lock_irqsave(shost->host_lock, flags); 1375 1375 list_for_each_entry(starget, &shost->__targets, siblings) { 1376 1376 if (starget->state == STARGET_DEL || 1377 - starget->state == STARGET_REMOVE || 1378 - starget == last_target) 1377 + starget->state == STARGET_REMOVE) 1379 1378 continue; 1380 1379 if (starget->dev.parent == dev || &starget->dev == dev) { 1381 1380 kref_get(&starget->reap_ref); 1382 - last_target = starget; 1383 1381 starget->state = STARGET_REMOVE; 1384 1382 spin_unlock_irqrestore(shost->host_lock, flags); 1385 1383 __scsi_remove_target(starget);