If unsharing fails, the decrease of the nr_saved_mfns stat was not being
undone. This would result in an underflow of the stat, as the retry would later
decrease the counter again.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
page = alloc_domheap_page(d, 0);
if ( !page )
{
+ /* Undo dec of nr_saved_mfns, as the retry will decrease again. */
+ atomic_inc(&nr_saved_mfns);
mem_sharing_page_unlock(old_page);
put_gfn(d, gfn);
/* Caller is responsible for placing an event