aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-14 19:52:32 -0400
committerRusty Russell <rusty@rustcorp.com.au>2014-10-14 19:55:07 -0400
commit6d62c37f1991aafc872f8d8be8ac60e57ede8605 (patch)
tree346383120729b4e6a49271289d617e0c8f487d48 /drivers/block
parentcd679048958011418f14a8fc7dfdb64ab72ca315 (diff)
virtio_blk: enable VQs early on restore
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after restore returns, virtio block violated this rule on restore by restarting queues, which might in theory cause the VQ to be used directly within restore. To fix, call virtio_device_ready before using starting queues. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/virtio_blk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 34ec273b1d46..930fee886917 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -804,10 +804,13 @@ static int virtblk_restore(struct virtio_device *vdev)
804 int ret; 804 int ret;
805 805
806 ret = init_vq(vdev->priv); 806 ret = init_vq(vdev->priv);
807 if (!ret) 807 if (ret)
808 blk_mq_start_stopped_hw_queues(vblk->disk->queue, true); 808 return ret;
809
810 virtio_device_ready(vdev);
809 811
810 return ret; 812 blk_mq_start_stopped_hw_queues(vblk->disk->queue, true);
813 return 0;
811} 814}
812#endif 815#endif
813 816