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

[Xen-changelog] [xen-3.4-testing] Fix domain reference leak



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1265794124 0
# Node ID 407d29f3d20e0d2c46352423840282e477a3b8ce
# Parent  bd2f6ae5540a2a2a691576f82865a5bd266f32ce
Fix domain reference leak

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
xen-unstable changeset:   20918:a3fa6d444b25
xen-unstable date:        Wed Feb 10 09:18:43 2010 +0000
---
 xen/arch/x86/mm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r bd2f6ae5540a -r 407d29f3d20e xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Mon Feb 08 11:52:37 2010 +0000
+++ b/xen/arch/x86/mm.c Wed Feb 10 09:28:44 2010 +0000
@@ -3552,6 +3552,7 @@ int steal_page(
     struct domain *d, struct page_info *page, unsigned int memflags)
 {
     unsigned long x, y;
+    bool_t drop_dom_ref = 0;
 
     spin_lock(&d->page_alloc_lock);
 
@@ -3579,11 +3580,13 @@ int steal_page(
     } while ( (y = cmpxchg(&page->count_info, x, x | 1)) != x );
 
     /* Unlink from original owner. */
-    if ( !(memflags & MEMF_no_refcount) )
-        d->tot_pages--;
+    if ( !(memflags & MEMF_no_refcount) && !--d->tot_pages )
+        drop_dom_ref = 1;
     page_list_del(page, &d->page_list);
 
     spin_unlock(&d->page_alloc_lock);
+    if ( unlikely(drop_dom_ref) )
+        put_domain(d);
     return 0;
 
  fail:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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