xcp-1.6-updates/xen-4.1.hg

changeset 23244:d4ae43e71dcf

Fix error recovery path in __gnttab_map_grant_ref

In file grant_table.c function __gnttab_map_grant_ref, if
__get_paged_frame failed, the effect of _set_status previously
called should be rollback, so the flag GTF_reading and _GTF_writing
will be recovered.


Signed-off-by: Haoyu Zhang <haoyu.zhang@huawei.com>
Signed-off-by: Liang Wang <hzwangliang.wang@huawei.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24701:3574f4d67843
xen-unstable date: Mon Feb 06 13:23:41 2012 -0800
author Haoyu Zhang <haoyu.zhang@huawei.com>
date Wed Mar 07 08:29:53 2012 +0000 (2012-03-07)
parents 871ed74bbefd
children b9e672d78cec
files xen/common/grant_table.c
line diff
     1.1 --- a/xen/common/grant_table.c	Wed Mar 07 08:26:25 2012 +0000
     1.2 +++ b/xen/common/grant_table.c	Wed Mar 07 08:29:53 2012 +0000
     1.3 @@ -567,7 +567,7 @@ static void
     1.4              gfn = sha1 ? sha1->frame : sha2->full_page.frame;
     1.5              rc = __get_paged_frame(gfn, &frame, !!(op->flags & GNTMAP_readonly), rd);
     1.6              if ( rc != GNTST_okay )
     1.7 -                goto unlock_out;
     1.8 +                goto unlock_out_clear;
     1.9              act->gfn = gfn;
    1.10              act->domid = ld->domain_id;
    1.11              act->frame = frame;
    1.12 @@ -722,7 +722,8 @@ static void
    1.13      if ( op->flags & GNTMAP_host_map )
    1.14          act->pin -= (op->flags & GNTMAP_readonly) ?
    1.15              GNTPIN_hstr_inc : GNTPIN_hstw_inc;
    1.16 -
    1.17 + 
    1.18 + unlock_out_clear:
    1.19      if ( !(op->flags & GNTMAP_readonly) &&
    1.20           !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
    1.21          gnttab_clear_flag(_GTF_writing, status);