[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200804241455.47462.rusty@rustcorp.com.au>
Date: Wed, 23 Apr 2008 23:55:47 -0500
From: Rusty Russell <rusty@...tcorp.com.au>
To: linux-kernel@...r.kernel.org
Cc: virtualization@...ts.linux-foundation.org
Subject: [PATCH 1/6] 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: Rusty Russell <rusty@...tcorp.com.au>
---
drivers/virtio/virtio_ring.c | 5 +++++
1 file changed, 5 insertions(+)
diff -r cbd83e592664 drivers/virtio/virtio_ring.c
--- a/drivers/virtio/virtio_ring.c Fri Apr 04 22:42:47 2008 +1100
+++ b/drivers/virtio/virtio_ring.c Sat Apr 05 21:12:42 2008 +1100
@@ -184,6 +184,11 @@ static void *vring_get_buf(struct virtqu
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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists