linux/drivers/virtio
Michael S. Tsirkin c436954309 virtio-balloon: do not call blocking ops when !TASK_RUNNING
[ Upstream commit 3d2a3774c1 ]

virtio balloon has this code:
        wait_event_interruptible(vb->config_change,
                                 (diff = towards_target(vb)) != 0
                                 || vb->need_stats_update
                                 || kthread_should_stop()
                                 || freezing(current));

Which is a problem because towards_target() call might block after
wait_event_interruptible sets task state to TAST_INTERRUPTIBLE, causing
the task_struct::state collision typical of nesting of sleeping
primitives

See also http://lwn.net/Articles/628628/ or Thomas's
bug report
http://article.gmane.org/gmane.linux.kernel.virtualization/24846
for a fuller explanation.

To fix, rewrite using wait_woken.

Cc: stable@vger.kernel.org
Reported-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2015-04-16 20:11:27 -04:00
..
config.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
Kconfig mm/balloon_compaction: add vmstat counters and kpageflags bit 2014-10-09 22:26:01 -04:00
Makefile virtio: remove CONFIG_VIRTIO_RING 2012-09-28 15:05:15 +09:30
virtio.c virtio: defer config changed notifications 2014-10-15 10:24:56 +10:30
virtio_balloon.c virtio-balloon: do not call blocking ops when !TASK_RUNNING 2015-04-16 20:11:27 -04:00
virtio_mmio.c virtio: unify config_changed handling 2014-10-15 10:24:54 +10:30
virtio_pci.c virtio-pci: move freeze/restore to virtio core 2014-10-15 10:24:55 +10:30
virtio_ring.c virtio_ring: unify direct/indirect code paths. 2014-09-13 12:52:35 -04:00