linux/drivers/block
Bob Liu efd1535270 xen-blkfront: don't call talk_to_blkback when already connected to blkback
Sometimes blkfront may twice receive blkback_changed() notification
(XenbusStateConnected) after migration, which will cause
talk_to_blkback() to be called twice too and confuse xen-blkback.

The flow is as follow:
   blkfront                                        blkback
blkfront_resume()
 > talk_to_blkback()
  > Set blkfront to XenbusStateInitialised
                                                front changed()
                                                 > Connect()
                                                  > Set blkback to XenbusStateConnected

blkback_changed()
 > Skip talk_to_blkback()
   because frontstate == XenbusStateInitialised
 > blkfront_connect()
  > Set blkfront to XenbusStateConnected

-----
And here we get another XenbusStateConnected notification leading
to:
-----
blkback_changed()
 > because now frontstate != XenbusStateInitialised
   talk_to_blkback() is also called again
  > blkfront state changed from
  XenbusStateConnected to XenbusStateInitialised
    (Which is not correct!)

						front_changed():
                                                 > Do nothing because blkback
                                                   already in XenbusStateConnected

Now blkback is in XenbusStateConnected but blkfront is still
in XenbusStateInitialised - leading to no disks.

Poking of the XenbusStateConnected state is allowed (to deal with
block disk change) and has to be dealt with. The most likely
cause of this bug are custom udev scripts hooking up the disks
and then validating the size.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2016-06-08 13:54:39 -04:00
..
aoe mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
drbd drbd: switch to using blk_queue_write_cache() 2016-04-12 16:00:39 -06:00
mtip32xx mtip32xx: remove call to blk_queue_flush() 2016-04-12 16:00:39 -06:00
paride paride: make 'verbose' parameter an 'int' again 2016-03-15 16:55:16 -07:00
rsxx
xen-blkback block: kill off q->flush_flags 2016-04-13 13:33:19 -06:00
zram
amiflop.c
ataflop.c
brd.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
cciss.c
cciss.h
cciss_cmd.h
cciss_scsi.c
cciss_scsi.h
cryptoloop.c block: cryptoloop - Use new skcipher interface 2016-01-27 20:35:43 +08:00
DAC960.c
DAC960.h
floppy.c floppy: refactor open() flags handling 2016-02-06 23:00:22 +01:00
hd.c
Kconfig cpqarray: remove it from the kernel 2016-03-14 09:06:01 -06:00
loop.c loop: switch to using blk_queue_write_cache() 2016-04-12 16:00:39 -06:00
loop.h
Makefile drivers:block: cpqarray clean up 2016-03-15 15:59:47 -07:00
mg_disk.c
nbd.c nbd: switch to using blk_queue_write_cache() 2016-04-12 16:00:39 -06:00
null_blk.c null_blk: add lightnvm null_blk device to the nullb_list 2016-03-18 18:10:37 -07:00
osdblk.c osdblk: switch to using blk_queue_write_cache() 2016-04-12 16:00:39 -06:00
pktcdvd.c
ps3disk.c ps3disk: switch to using blk_queue_write_cache() 2016-04-12 16:00:39 -06:00
ps3vram.c
rbd.c rbd: use GFP_NOIO consistently for request allocations 2016-04-05 22:11:37 +02:00
rbd_types.h
skd_main.c skd: remove broken discard support 2016-04-25 19:12:38 -06:00
skd_s1120.h
smart1,2.h
sunvdc.c
swim.c
swim3.c
swim_asm.S
sx8.c
umem.c
umem.h
virtio_blk.c virtio_blk: switch to using blk_queue_write_cache() 2016-04-12 16:00:39 -06:00
xen-blkfront.c xen-blkfront: don't call talk_to_blkback when already connected to blkback 2016-06-08 13:54:39 -04:00
xsysace.c
z2ram.c