From: Michael S. Tsirkin Date: Mon, 2 Jul 2012 07:33:08 +0000 (+0300) Subject: virtio-balloon: fix add/get API use X-Git-Tag: v3.5-rc7~39^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c378abc5c0c6fc8e3acf5968924d274503819b3;p=pandora-kernel.git virtio-balloon: fix add/get API use Since ee7cd8981e15bcb365fc762afe3fc47b8242f630 'virtio: expose added descriptors immediately.', in virtio balloon virtqueue_get_buf might now run concurrently with virtqueue_kick. I audited both and this seems safe in practice but this is not guaranteed by the API. Additionally, a spurious interrupt might in theory make virtqueue_get_buf run in parallel with virtqueue_add_buf, which is racy. While we might try to protect against spurious callbacks it's easier to fix the driver: balloon seems to be the only one (mis)using the API like this, so let's just fix balloon. Signed-off-by: Michael S. Tsirkin Signed-off-by: Rusty Russell (removed unused var) --- Reading git-diff-tree failed