You need to sign in or sign up before continuing.
提交 e619e6cb 编写于 作者: B Bart Van Assche 提交者: James Bottomley

Revert "scsi: Fix a bdi reregistration race"

The SCSI sd driver probes SCSI devices asynchronously. The sd_remove()
function, called indirectly by device_del(), waits until asynchronous
probing has finished. Since the block layer queue must only be cleaned
up after probing has finished, device_del() has to be called before
blk_cleanup_queue(). Hence revert commit bf2cf3ba.
Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
上级 8005c49d
......@@ -1110,7 +1110,9 @@ void __scsi_remove_device(struct scsi_device *sdev)
device_unregister(&sdev->sdev_dev);
transport_remove_device(dev);
scsi_dh_remove_device(sdev);
}
device_del(dev);
} else
put_device(&sdev->sdev_dev);
/*
* Stop accepting new requests and wait until all queuecommand() and
......@@ -1121,16 +1123,6 @@ void __scsi_remove_device(struct scsi_device *sdev)
blk_cleanup_queue(sdev->request_queue);
cancel_work_sync(&sdev->requeue_work);
/*
* Remove the device after blk_cleanup_queue() has been called such
* a possible bdi_register() call with the same name occurs after
* blk_cleanup_queue() has called bdi_destroy().
*/
if (sdev->is_visible)
device_del(dev);
else
put_device(&sdev->sdev_dev);
if (sdev->host->hostt->slave_destroy)
sdev->host->hostt->slave_destroy(sdev);
transport_destroy_device(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册