|
@@ -1415,7 +1415,10 @@ static void __scsi_remove_target(struct scsi_target *starget)
|
|
* check.
|
|
* check.
|
|
*/
|
|
*/
|
|
if (sdev->channel != starget->channel ||
|
|
if (sdev->channel != starget->channel ||
|
|
- sdev->id != starget->id ||
|
|
|
|
|
|
+ sdev->id != starget->id)
|
|
|
|
+ continue;
|
|
|
|
+ if (sdev->sdev_state == SDEV_DEL ||
|
|
|
|
+ sdev->sdev_state == SDEV_CANCEL ||
|
|
!get_device(&sdev->sdev_gendev))
|
|
!get_device(&sdev->sdev_gendev))
|
|
continue;
|
|
continue;
|
|
spin_unlock_irqrestore(shost->host_lock, flags);
|
|
spin_unlock_irqrestore(shost->host_lock, flags);
|