Skip to content

Commit

Permalink
virtio: ignore corrupted virtqueues rather than spinning.
Browse files Browse the repository at this point in the history
A corrupt virtqueue (caused by the other end screwing up) can have
strange results such as a driver spinning: just bail when we try to
get a buffer from a known-broken queue.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed May 2, 2008
1 parent 886c35f commit 5ef8275
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/virtio/virtio_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ static void *vring_get_buf(struct virtqueue *_vq, unsigned int *len)

START_USE(vq);

if (unlikely(vq->broken)) {
END_USE(vq);
return NULL;
}

if (!more_used(vq)) {
pr_debug("No more buffers in queue\n");
END_USE(vq);
Expand Down

0 comments on commit 5ef8275

Please sign in to comment.