提交 5ef82752 编写于 作者: R Rusty Russell

virtio: ignore corrupted virtqueues rather than spinning.

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: NRusty Russell <rusty@rustcorp.com.au>
上级 886c35fb
...@@ -184,6 +184,11 @@ static void *vring_get_buf(struct virtqueue *_vq, unsigned int *len) ...@@ -184,6 +184,11 @@ static void *vring_get_buf(struct virtqueue *_vq, unsigned int *len)
START_USE(vq); START_USE(vq);
if (unlikely(vq->broken)) {
END_USE(vq);
return NULL;
}
if (!more_used(vq)) { if (!more_used(vq)) {
pr_debug("No more buffers in queue\n"); pr_debug("No more buffers in queue\n");
END_USE(vq); END_USE(vq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册