virtio: fix suspend when using virtio_balloon
authorMarcelo Tosatti <mtosatti@redhat.com>
Fri, 17 Apr 2009 00:14:04 +0000 (21:14 -0300)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 19 Apr 2009 13:44:01 +0000 (23:14 +0930)
Break out of wait_event_interruptible() if freezing has been requested,
in the vballoon thread. Without this change vballoon refuses to stop and
the system can't suspend.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
drivers/virtio/virtio_balloon.c

index 59268266b79a5b7c6b439c6e9b210bb25c4236a3..9c76a061a04dc7235ad689cea438fc8d0c6cfedf 100644 (file)
@@ -190,7 +190,8 @@ static int balloon(void *_vballoon)
                try_to_freeze();
                wait_event_interruptible(vb->config_change,
                                         (diff = towards_target(vb)) != 0
-                                        || kthread_should_stop());
+                                        || kthread_should_stop()
+                                        || freezing(current));
                if (diff > 0)
                        fill_balloon(vb, diff);
                else if (diff < 0)