未验证 提交 d0198cbf 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!465 Revert "scsi: fix iscsi rescan fails to create block"

Merge Pull Request from: @zhangjialin11 
 
Revert "scsi: fix iscsi rescan fails to create block"
This commit has a soft lock problem. 
 
Link:https://gitee.com/openeuler/kernel/pulls/465 

Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
......@@ -1503,13 +1503,6 @@ void scsi_remove_device(struct scsi_device *sdev)
}
EXPORT_SYMBOL(scsi_remove_device);
static int scsi_device_try_get(struct scsi_device *sdev)
{
if (!kobject_get_unless_zero(&sdev->sdev_gendev.kobj))
return -ENXIO;
return 0;
}
static void __scsi_remove_target(struct scsi_target *starget)
{
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
......@@ -1528,7 +1521,9 @@ static void __scsi_remove_target(struct scsi_target *starget)
if (sdev->channel != starget->channel ||
sdev->id != starget->id)
continue;
if (scsi_device_try_get(sdev))
if (sdev->sdev_state == SDEV_DEL ||
sdev->sdev_state == SDEV_CANCEL ||
!get_device(&sdev->sdev_gendev))
continue;
spin_unlock_irqrestore(shost->host_lock, flags);
scsi_remove_device(sdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册