[PATCH v3] virtio-blk: Fix hot-unplug race in remove method

2012-05-04 Thread Asias He
If we reset the virtio-blk device before the requests already dispatched to the virtio-blk driver from the block layer are finised, we will stuck in blk_cleanup_queue() and the remove will fail. blk_cleanup_queue() calls blk_drain_queue() to drain all requests queued before DEAD marking. However i

[PATCH v3] virtio-blk: Fix hot-unplug race in remove method

2012-05-04 Thread Asias He
If we reset the virtio-blk device before the requests already dispatched to the virtio-blk driver from the block layer are finised, we will stuck in blk_cleanup_queue() and the remove will fail. blk_cleanup_queue() calls blk_drain_queue() to drain all requests queued before DEAD marking. However i

Re: [PATCH v3] virtio-blk: Fix hot-unplug race in remove method

2012-05-06 Thread Rusty Russell
On Fri, 4 May 2012 16:39:49 +0800, Asias He wrote: > If we reset the virtio-blk device before the requests already dispatched > to the virtio-blk driver from the block layer are finised, we will stuck > in blk_cleanup_queue() and the remove will fail. > > blk_cleanup_queue() calls blk_drain_queu

Re: [PATCH v3] virtio-blk: Fix hot-unplug race in remove method

2012-05-06 Thread Rusty Russell
On Fri, 4 May 2012 20:22:04 +0800, Asias He wrote: > If we reset the virtio-blk device before the requests already dispatched > to the virtio-blk driver from the block layer are finised, we will stuck > in blk_cleanup_queue() and the remove will fail. > > blk_cleanup_queue() calls blk_drain_queu