]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: xen-blkfront: only talk_to_blkback() when in XenbusStateInitialising
authorBob Liu <bob.liu@oracle.com>
Fri, 19 Jun 2015 04:23:00 +0000 (00:23 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 22 Jun 2015 14:06:29 +0000 (10:06 -0400)
commit13a7cf5acac678346f54e6805b1de1d5646b1392
tree80cd735b3b9c175ca1dbccba75042b0735337647
parentdf96041ce35b260f1ac6fbaef52dffa063c31bcd
drivers: xen-blkfront: only talk_to_blkback() when in XenbusStateInitialising

Patch 28f4ea2d892994a9c0baf73f27231fd764bc7608
"drivers: xen-blkback: delay pending_req allocation to connect_ring"
exposed an problem that Xen blkfront has. There is a race
with XenStored and the drivers such that we can see two:

vbd vbd-268440320: blkfront:blkback_changed to state 2.
vbd vbd-268440320: blkfront:blkback_changed to state 2.
vbd vbd-268440320: blkfront:blkback_changed to state 4.

state changes to XenbusStateInitWait ('2'). The end result is that
blkback_changed() receives two notify and calls twice setup_blkring().

While the backend driver may only get the first setup_blkring() which is
wrong and reads out-dated (or reads them as they are being updated
with new ring-ref values).

The end result is that the ring ends up being incorrectly set.

The other drivers in the tree have such checks already in.

Reported-and-Tested-by: Robert Butera <robert.butera@oracle.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c