[PATCH v3] virtio-scsi: Fix the race condition in virtscsi_handle_event

2015-01-06 Thread Fam Zheng
There is a race condition in virtscsi_handle_event, when many device hotplug/unplug events flush in quickly. The scsi_remove_device in virtscsi_handle_transport_reset may trigger the BUG_ON in scsi_target_reap, because the state is altered behind it, probably by scsi_scan_host of another event.

Re: [PATCH v3] virtio-scsi: Fix the race condition in virtscsi_handle_event

2015-01-06 Thread Michael S. Tsirkin
On Tue, Jan 06, 2015 at 09:25:05PM +0800, Fam Zheng wrote: There is a race condition in virtscsi_handle_event, when many device hotplug/unplug events flush in quickly. The scsi_remove_device in virtscsi_handle_transport_reset may trigger the BUG_ON in scsi_target_reap, because the state is

Re: [PATCH v3] virtio-scsi: Fix the race condition in virtscsi_handle_event

2015-01-06 Thread Fam Zheng
On Tue, 01/06 16:54, Michael S. Tsirkin wrote: On Tue, Jan 06, 2015 at 09:25:05PM +0800, Fam Zheng wrote: There is a race condition in virtscsi_handle_event, when many device hotplug/unplug events flush in quickly. The scsi_remove_device in virtscsi_handle_transport_reset may trigger