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 wrote: > > > > There is a race condition in virtscsi_handle_event, when many device > > hotplug/unplug e

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 wrote: > > > > There is a race condition in virtscsi_handle_event, when many device > > hotplug/unplug events flush in quickl

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 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_tra

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 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 alte

[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. I'