ia64/linux-2.6.18-xen.hg

changeset 868:42dfb4e2bce0

linux/blktap: fix blktap_clear_pte().

fix blktap_clear_pte(). In case of vma->vm_file == NULL
case wasn't handled correctly.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 05 13:32:55 2009 +0100 (2009-05-05)
parents 978499ee4f39
children 271d9b9bee40
files drivers/xen/blktap/blktap.c
line diff
     1.1 --- a/drivers/xen/blktap/blktap.c	Tue Apr 28 13:44:22 2009 +0100
     1.2 +++ b/drivers/xen/blktap/blktap.c	Tue May 05 13:32:55 2009 +0100
     1.3 @@ -314,7 +314,7 @@ static pte_t blktap_clear_pte(struct vm_
     1.4  	pte_t copy;
     1.5  	tap_blkif_t *info = NULL;
     1.6  	int offset, seg, usr_idx, pending_idx, mmap_idx;
     1.7 -	unsigned long uvstart;
     1.8 +	unsigned long uvstart = 0;
     1.9  	unsigned long kvaddr;
    1.10  	struct page *pg;
    1.11  	struct grant_handle_pair *khandle;
    1.12 @@ -328,9 +328,8 @@ static pte_t blktap_clear_pte(struct vm_
    1.13  	if (vma->vm_file != NULL) {
    1.14  		info = vma->vm_file->private_data;
    1.15  		uvstart = info->rings_vstart + (RING_PAGES << PAGE_SHIFT);
    1.16 -	} else
    1.17 -		uvstart = uvaddr;	/* make the following if clause true */
    1.18 -	if (uvaddr < uvstart)
    1.19 +	}
    1.20 +	if (vma->vm_file == NULL || uvaddr < uvstart)
    1.21  		return ptep_get_and_clear_full(vma->vm_mm, uvaddr, 
    1.22  					       ptep, is_fullmm);
    1.23