Skip to content

Commit 0fc9dd0

Browse files
roygergregkh
authored andcommitted
xen/balloon: make the balloon wait interruptible
commit 88a479f upstream. So it can be killed, or else processes can get hung indefinitely waiting for balloon pages. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Juergen Gross <jgross@suse.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200727091342.52325-3-roger.pau@citrix.com Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bbe6145 commit 0fc9dd0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/xen/balloon.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,13 @@ static int add_ballooned_pages(int nr_pages)
570570
if (xen_hotplug_unpopulated) {
571571
st = reserve_additional_memory();
572572
if (st != BP_ECANCELED) {
573+
int rc;
574+
573575
mutex_unlock(&balloon_mutex);
574-
wait_event(balloon_wq,
576+
rc = wait_event_interruptible(balloon_wq,
575577
!list_empty(&ballooned_pages));
576578
mutex_lock(&balloon_mutex);
577-
return 0;
579+
return rc ? -ENOMEM : 0;
578580
}
579581
}
580582

0 commit comments

Comments
 (0)