From af028abaaa2d14db767a09f0c3f1427be2889689 Mon Sep 17 00:00:00 2001 From: Eric Mei Date: Tue, 4 May 2010 19:14:34 -0600 Subject: [PATCH] b=22669 fix fault page index handler in newer kernel. r=wangdi r=rread --- lustre/llite/llite_mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/llite/llite_mmap.c b/lustre/llite/llite_mmap.c index 30fa9bf..31ccf8c 100644 --- a/lustre/llite/llite_mmap.c +++ b/lustre/llite/llite_mmap.c @@ -153,7 +153,7 @@ int ll_fault_io_init(struct vm_area_struct *vma, struct lu_env **env_ret, LASSERT(io->ci_obj != NULL); fio = &io->u.ci_fault; - fio->ft_index = vma->vm_pgoff + index; + fio->ft_index = index; fio->ft_writable = (vma->vm_flags&writable) == writable; fio->ft_executable = vma->vm_flags&VM_EXEC; @@ -213,7 +213,7 @@ struct page *ll_nopage(struct vm_area_struct *vma, unsigned long address, int result; ENTRY; - pg_offset = (address - vma->vm_start) >> PAGE_SHIFT; + pg_offset = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; result = ll_fault_io_init(vma, &env, &nest, pg_offset, &ra_flags); if (env == NULL) return NOPAGE_SIGBUS; -- 1.8.3.1