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

2015-01-05 Thread Michael S. Tsirkin
On Tue, Jan 06, 2015 at 12:10:59AM +0200, Michael S. Tsirkin wrote: On Mon, Jan 05, 2015 at 11:48:47AM -0800, Venkatesh Srinivas wrote: On Sun, Jan 4, 2015 at 10:04 PM, Fam Zheng f...@redhat.com wrote: There is a race condition in virtscsi_handle_event, when many device

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

2015-01-05 Thread Michael S. Tsirkin
On Mon, Jan 05, 2015 at 11:48:47AM -0800, Venkatesh Srinivas wrote: On Sun, Jan 4, 2015 at 10:04 PM, Fam Zheng f...@redhat.com wrote: There is a race condition in virtscsi_handle_event, when many device hotplug/unplug events flush in quickly. The scsi_remove_device in

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

2015-01-05 Thread Fam Zheng
On Tue, 01/06 00:10, Michael S. Tsirkin wrote: On Mon, Jan 05, 2015 at 11:48:47AM -0800, Venkatesh Srinivas wrote: On Sun, Jan 4, 2015 at 10:04 PM, Fam Zheng f...@redhat.com wrote: There is a race condition in virtscsi_handle_event, when many device hotplug/unplug events flush in

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

2015-01-05 Thread Venkatesh Srinivas
On Sun, Jan 4, 2015 at 10:04 PM, Fam Zheng f...@redhat.com 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

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

2015-01-04 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.