projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
886c35f
)
virtio: ignore corrupted virtqueues rather than spinning.
author
Rusty Russell
<rusty@rustcorp.com.au>
Sat, 3 May 2008 02:50:43 +0000
(21:50 -0500)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Fri, 2 May 2008 11:50:43 +0000
(21:50 +1000)
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 <rusty@rustcorp.com.au>
drivers/virtio/virtio_ring.c
patch
|
blob
|
history
diff --git
a/drivers/virtio/virtio_ring.c
b/drivers/virtio/virtio_ring.c
index c2fa5c6308133e5bd9c4e4c39e4a6c0b9b8b7c4b..937a49d6772cc5271d22ef48cb14df6bf56c07f7 100644
(file)
--- a/
drivers/virtio/virtio_ring.c
+++ b/
drivers/virtio/virtio_ring.c
@@
-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);