[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] balloon: don't BUG() when balloon is empty


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Thu, 03 May 2018 08:22:03 +0000
  • Delivery-date: Thu, 03 May 2018 08:22:09 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xenproject.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1525335319 -7200
#      Thu May 03 10:15:19 2018 +0200
# Node ID f8a110b3f989066e9b987739323c427a030efd45
# Parent  0f354e1b83792d0cf6a91f638ac843b43ba48b4c
balloon: don't BUG() when balloon is empty

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 0f354e1b8379 -r f8a110b3f989 drivers/xen/balloon/balloon.c
--- a/drivers/xen/balloon/balloon.c     Thu May 03 10:12:14 2018 +0200
+++ b/drivers/xen/balloon/balloon.c     Thu May 03 10:15:19 2018 +0200
@@ -254,13 +254,18 @@ static int increase_reservation(unsigned
 
        page = balloon_first_page();
        for (i = 0; i < nr_pages; i++) {
-               BUG_ON(page == NULL);
-               frame_list[i] = page_to_pfn(page);;
+               if (!page) {
+                       if (i)
+                               break;
+                       rc = -ENXIO;
+                       goto out;
+               }
+               frame_list[i] = page_to_pfn(page);
                page = balloon_next_page(page);
        }
 
        set_xen_guest_handle(reservation.extent_start, frame_list);
-       reservation.nr_extents = nr_pages;
+       reservation.nr_extents = i;
        rc = HYPERVISOR_memory_op(XENMEM_populate_physmap, &reservation);
        if (rc < 0)
                goto out;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.