diff options
author | Haoyu Zhang <haoyu.zhang@huawei.com> | 2012-03-07 08:29:53 +0000 |
---|---|---|
committer | Haoyu Zhang <haoyu.zhang@huawei.com> | 2012-03-07 08:29:53 +0000 |
commit | ffd14d57a42a3f6b0353c84ecf2fb106245e8af9 (patch) | |
tree | de46ae561b349ad280181f51b8a3f050e80d327b | |
parent | abb045f48c08680a2a65aa57ae626e963d32f4cf (diff) | |
download | xen-ffd14d57a42a3f6b0353c84ecf2fb106245e8af9.tar.gz xen-ffd14d57a42a3f6b0353c84ecf2fb106245e8af9.tar.bz2 xen-ffd14d57a42a3f6b0353c84ecf2fb106245e8af9.zip |
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
-rw-r--r-- | xen/common/grant_table.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index f3b11a2c56..2b23072b07 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -567,7 +567,7 @@ __gnttab_map_grant_ref( gfn = sha1 ? sha1->frame : sha2->full_page.frame; rc = __get_paged_frame(gfn, &frame, !!(op->flags & GNTMAP_readonly), rd); if ( rc != GNTST_okay ) - goto unlock_out; + goto unlock_out_clear; act->gfn = gfn; act->domid = ld->domain_id; act->frame = frame; @@ -722,7 +722,8 @@ __gnttab_map_grant_ref( if ( op->flags & GNTMAP_host_map ) act->pin -= (op->flags & GNTMAP_readonly) ? GNTPIN_hstr_inc : GNTPIN_hstw_inc; - + + unlock_out_clear: if ( !(op->flags & GNTMAP_readonly) && !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) ) gnttab_clear_flag(_GTF_writing, status); |