linux/drivers/block
Asias He 483001c765 virtio-blk: Reset device after blk_cleanup_queue()
blk_cleanup_queue() will call blk_drian_queue() to drain all the
requests before queue DEAD marking. If we reset the device before
blk_cleanup_queue() the drain would fail.

1) if the queue is stopped in do_virtblk_request() because device is
full, the q->request_fn() will not be called.

blk_drain_queue() {
   while(true) {
      ...
      if (!list_empty(&q->queue_head))
        __blk_run_queue(q) {
	    if (queue is not stoped)
		q->request_fn()
	}
      ...
   }
}

Do no reset the device before blk_cleanup_queue() gives the chance to
start the queue in interrupt handler blk_done().

2) In commit b79d866c8b, We abort requests
dispatched to driver before blk_cleanup_queue(). There is a race if
requests are dispatched to driver after the abort and before the queue
DEAD mark. To fix this, instead of aborting the requests explicitly, we
can just reset the device after after blk_cleanup_queue so that the
device can complete all the requests before queue DEAD marking in the
drain process.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Cc: kvm@vger.kernel.org
Cc: stable@kernel.org
Signed-off-by: Asias He <asias@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-30 13:30:51 +09:30
..
aoe switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
drbd Merge branch 'for-jens' of git://git.drbd.org/linux-drbd into for-linus 2012-06-13 21:19:42 +02:00
mtip32xx mtip32xx: Create debugfs entries for troubleshooting 2012-06-05 09:13:49 +02:00
paride paride/pcd: fix bool verbose module parameter. 2012-01-13 09:32:26 +10:30
xen-blkback Merge branch 'stable/for-jens-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-linus 2012-06-13 21:19:06 +02:00
amiflop.c fs: move code out of buffer.c 2012-01-03 22:54:07 -05:00
ataflop.c block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers 2011-04-21 21:33:05 +02:00
brd.c block: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
cciss.c block: add and use scsi_blk_cmd_ioctl 2012-01-14 15:07:24 -08:00
cciss.h cciss: Adds simple mode functionality 2011-08-08 11:40:15 +02:00
cciss_cmd.h cciss: use new doorbell-bit-5 reset method 2011-05-06 08:23:55 -06:00
cciss_scsi.c cciss: Fix scsi tape io with more than 255 scatter gather elements 2012-03-22 21:40:09 +01:00
cciss_scsi.h cciss: add cciss_tape_cmds module paramter 2011-05-06 08:23:59 -06:00
cpqarray.c drivers/block/cpqarray.c: use pci_dev->revision 2011-09-21 10:02:13 +02:00
cpqarray.h
cryptoloop.c
DAC960.c dac960: Remove unused variables from DAC960_CreateProcEntries() 2012-05-11 16:42:14 +02:00
DAC960.h
floppy.c floppy: cancel any pending fd_timeouts before adding a new one 2012-07-03 15:51:22 -07:00
hd.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ida_cmd.h
ida_ioctl.h
Kconfig usb/ub: deprecate & schedule for removal the "Low Performance USB Block" driver 2012-03-16 13:30:10 -07:00
loop.c blk: fix wrong idr_pre_get() error check in loop.c 2012-07-14 15:39:58 -07:00
Makefile Merge git://git.infradead.org/users/willy/linux-nvme 2012-01-18 12:34:09 -08:00
mg_disk.c mg_disk: Use struct dev_pm_ops for power management 2012-07-06 19:07:00 +02:00
nbd.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
nvme.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
osdblk.c
pktcdvd.c block: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
ps3disk.c block: Fix files that are modules and hence need module.h 2011-10-31 19:31:13 -04:00
ps3vram.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
rbd.c rbd: endian bug in rbd_req_cb() 2012-07-17 21:30:31 -07:00
rbd_types.h rbd: small changes 2012-03-22 10:47:50 -05:00
smart1,2.h fix typos 'comamnd' -> 'command' in comments 2011-02-02 11:31:21 +01:00
sunvdc.c powerpc+sparc/vio: Modernize driver registration 2012-03-28 11:33:24 +11:00
swim.c m68k/mac: cleanup forward declarations 2011-12-10 19:52:46 +01:00
swim3.c block/swim3: Locking fixes 2011-12-12 12:42:12 +01:00
swim_asm.S
sx8.c block, sx8: fix pointer math issue getting fw version 2012-03-03 19:44:39 +01:00
ub.c usb/ub: deprecate & schedule for removal the "Low Performance USB Block" driver 2012-03-16 13:30:10 -07:00
umem.c umem: fix up unplugging 2012-06-13 21:17:21 +02:00
umem.h
virtio_blk.c virtio-blk: Reset device after blk_cleanup_queue() 2012-07-30 13:30:51 +09:30
xd.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
xd.h
xen-blkfront.c xen/blkfront: Add WARN to deal with misbehaving backends. 2012-06-12 08:29:04 -04:00
xsysace.c block: xsysace: Don't use NO_IRQ 2012-01-05 08:34:29 +01:00
z2ram.c