Whamcloud - gitweb
b=22669 fix fault page index handler in newer kernel.
authorEric Mei <eric.mei@oracle.com>
Wed, 5 May 2010 01:14:34 +0000 (19:14 -0600)
committerRobert Read <robert.read@oracle.com>
Wed, 5 May 2010 01:29:53 +0000 (18:29 -0700)
r=wangdi
r=rread

lustre/llite/llite_mmap.c

index 30fa9bf..31ccf8c 100644 (file)
@@ -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;