OSDN Git Service

virtio_blk: don't crash, report error if virtqueue is broken.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 13 Mar 2014 00:53:39 +0000 (11:23 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 13 Mar 2014 00:57:56 +0000 (11:27 +1030)
commit5261b85e586afe6ebe54e16e0a8acc32fc6d4902
tree10ec38ad40d5e80e527b397c9f086d89d7175175
parenta7c58146cf9a782113629021ba5420582fef265e
virtio_blk: don't crash, report error if virtqueue is broken.

A bad implementation of virtio might cause us to mark the virtqueue
broken: we'll dev_err() in that case, and the device is useless, but
let's not BUG_ON().

ENOMEM or ENOSPC implies the ring is full, and we should try again
later (-ENOMEM is documented to happen, but doesn't, as we fall
through to ENOSPC).

EIO means it's broken.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/block/virtio_blk.c