]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86/mm: change ASSERTs to BUG_ONs in mem_sharing.c
authorKeir Fraser <keir@xen.org>
Thu, 9 Dec 2010 10:14:57 +0000 (10:14 +0000)
committerKeir Fraser <keir@xen.org>
Thu, 9 Dec 2010 10:14:57 +0000 (10:14 +0000)
These two ASSERTs have important side-effects so make them into
BUG_ONs
consistent with the rest of the file.
Bug found by Jui-Hao Chiang <juihaochiang@gmail.com>.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   22467:89116f28083f
xen-unstable date:        Wed Dec 08 10:46:31 2010 +0000

xen/arch/x86/mm/mem_sharing.c

index cb461ac928290244dfc950f307e1d43ee0c1f42f..1f6bbfe2da3a650ac0ff97bf5ae95a1ebd909fac 100644 (file)
@@ -545,7 +545,7 @@ int mem_sharing_nominate_page(struct domain *d,
          * it a few lines above.
          * The mfn needs to revert back to rw type. This should never fail,
          * since no-one knew that the mfn was temporarily sharable */
-        ASSERT(page_make_private(d, page) == 0);
+        BUG_ON(page_make_private(d, page) != 0);
         mem_sharing_hash_destroy(hash_entry);
         mem_sharing_gfn_destroy(gfn_info, 0);
         shr_unlock();
@@ -699,7 +699,7 @@ gfn_found:
     unmap_domain_page(s);
     unmap_domain_page(t);
 
-    ASSERT(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) != 0);
+    BUG_ON(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) == 0);
     put_page_and_type(old_page);
 
 private_page_found: