alistair23-linux/drivers/block
Juergen Gross 4646441130 xen/blkback: fix disconnect while I/Os in flight
Today disconnecting xen-blkback is broken in case there are still
I/Os in flight: xen_blkif_disconnect() will bail out early without
releasing all resources in the hope it will be called again when
the last request has terminated. This, however, won't happen as
xen_blkif_free() won't be called on termination of the last running
request: xen_blkif_put() won't decrement the blkif refcnt to 0 as
xen_blkif_disconnect() didn't finish before thus some xen_blkif_put()
calls in xen_blkif_disconnect() didn't happen.

To solve this deadlock xen_blkif_disconnect() and
xen_blkif_alloc_rings() shouldn't use xen_blkif_put() and
xen_blkif_get() but use some other way to do their accounting of
resources.

This at once fixes another error in xen_blkif_disconnect(): when it
returned early with -EBUSY for another ring than 0 it would call
xen_blkif_put() again for already handled rings on a subsequent call.
This will lead to inconsistencies in the refcnt handling.

Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Steven Haigh <netwiz@crc.id.au>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2017-06-13 16:04:18 -04:00
..
aoe block: Use pointer to backing_dev_info from request_queue 2017-02-02 08:20:48 -07:00
drbd block: remove the discard_zeroes_data flag 2017-04-08 11:25:38 -06:00
mtip32xx block: remove the discard_zeroes_data flag 2017-04-08 11:25:38 -06:00
paride parport/pf: stop sharing request queue across multiple gendisks 2017-03-28 15:06:58 -06:00
rsxx rsxx: remove the discard_zeroes_data flag 2017-04-08 11:25:38 -06:00
xen-blkback xen/blkback: fix disconnect while I/Os in flight 2017-06-13 16:04:18 -04:00
zram zram: implement REQ_OP_WRITE_ZEROES 2017-04-08 11:25:38 -06:00
amiflop.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ataflop.c
brd.c brd: remove discard support 2017-04-08 11:25:38 -06:00
cciss.c scsi: cciss: correct check map error. 2017-02-23 17:10:32 -05:00
cciss.h SCSI misc on 20170220 2017-02-21 11:51:42 -08:00
cciss_cmd.h
cciss_scsi.c cciss: Remove kmalloc cast 2017-02-22 11:54:49 -07:00
cciss_scsi.h
cryptoloop.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
DAC960.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
DAC960.h
floppy.c block: floppy: use setup_timer 2017-03-24 08:22:07 -06:00
Kconfig remove the mg_disk driver 2017-04-14 14:00:49 -06:00
loop.c block: remove the discard_zeroes_data flag 2017-04-08 11:25:38 -06:00
loop.h block: loop: support DIO & AIO 2015-09-23 11:01:16 -06:00
Makefile remove the mg_disk driver 2017-04-14 14:00:49 -06:00
nbd.c nbd: add a flag to destroy an nbd device on disconnect 2017-04-17 09:58:42 -06:00
null_blk.c blk-mq: constify struct blk_mq_ops 2017-03-31 08:28:58 -06:00
osdblk.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
pktcdvd.c block: Use pointer to backing_dev_info from request_queue 2017-02-02 08:20:48 -07:00
ps3disk.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
ps3vram.c block: convert to device_add_disk() 2016-06-27 12:26:08 -07:00
rbd.c rbd: remove the discard_zeroes_data flag 2017-04-08 11:25:38 -06:00
rbd_types.h rbd: RBD_V{1,2}_DATA_FORMAT macros 2017-02-20 12:16:15 +01:00
skd_main.c skd: implement trivial scsi ioctls directly 2017-01-31 10:53:03 -07:00
skd_s1120.h
smart1,2.h
sunvdc.c sunvdc: Add support for setting physical sector size 2017-02-23 08:24:08 -08:00
swim.c swim: stop sharing request queue across multiple gendisks 2017-03-28 15:06:58 -06:00
swim3.c sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
swim_asm.S
sx8.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
umem.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
umem.h
virtio_blk.c blk-mq: constify struct blk_mq_ops 2017-03-31 08:28:58 -06:00
xen-blkfront.c blkfront: add uevent for size change 2017-04-18 11:10:55 -04:00
xsysace.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
z2ram.c