ia64/xen-unstable

changeset 9899:3e5a203c5489

Fix blktap "bad page state" bug.

Signed-off-by: Andrew Warfield <andrew.warfield@cl.cam.ac.uk>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Apr 30 09:39:04 2006 +0100 (2006-04-30)
parents 369bdfa1e04a
children ce48ea86ad72
files linux-2.6-xen-sparse/mm/memory.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/mm/memory.c	Sun Apr 30 09:32:21 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/mm/memory.c	Sun Apr 30 09:39:04 2006 +0100
     1.3 @@ -968,6 +968,7 @@ int get_user_pages(struct task_struct *t
     1.4  {
     1.5  	int i;
     1.6  	unsigned int vm_flags;
     1.7 +	int xenpage = 0;
     1.8  
     1.9  	/* 
    1.10  	 * Require read or write permissions.
    1.11 @@ -1025,10 +1026,14 @@ int get_user_pages(struct task_struct *t
    1.12  		if (vma && (vma->vm_flags & VM_FOREIGN)) {
    1.13  			struct page **map = vma->vm_private_data;
    1.14  			int offset = (start - vma->vm_start) >> PAGE_SHIFT;
    1.15 -
    1.16 +			xenpage =1;
    1.17  			if (map[offset] != NULL) {
    1.18 -				if (pages)
    1.19 -					pages[i] = map[offset];
    1.20 +			        if (pages) {
    1.21 +			                struct page *page = map[offset];
    1.22 +					
    1.23 +					pages[i] = page;
    1.24 +					get_page(page);
    1.25 +				}
    1.26  				if (vmas)
    1.27  					vmas[i] = vma;
    1.28  				i++;