Whamcloud - gitweb
LU-435 Add VM_FAULT_RETRY handling
authorBobi Jam <bobijam@whamcloud.com>
Wed, 22 Jun 2011 04:14:15 +0000 (12:14 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 28 Jun 2011 16:48:07 +0000 (09:48 -0700)
2.6.32 kernel add VM_FAULT_RETRY option in handle page fault, we
need handle it as well.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I71d1c51bc297d1e0e8cc38e11b8a724edf9d1ae7
Reviewed-on: http://review.whamcloud.com/997
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jay@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/llite_internal.h
lustre/llite/llite_mmap.c
lustre/llite/vvp_io.c

index 6411381..a9fdab1 100644 (file)
 #define FMODE_EXEC 0
 #endif
 
 #define FMODE_EXEC 0
 #endif
 
+#ifndef VM_FAULT_RETRY
+#define VM_FAULT_RETRY 0
+#endif
+
 /** Only used on client-side for indicating the tail of dir hash/offset. */
 #define LL_DIR_END_OFF          0x7fffffffffffffffULL
 #define LL_DIR_END_OFF_32BIT    0x7fffffffUL
 /** Only used on client-side for indicating the tail of dir hash/offset. */
 #define LL_DIR_END_OFF          0x7fffffffffffffffULL
 #define LL_DIR_END_OFF_32BIT    0x7fffffffUL
index 39d3756..81ee3fb 100644 (file)
@@ -287,7 +287,7 @@ int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
         fault_ret = vio->u.fault.fault.ft_flags;
 
 out_err:
         fault_ret = vio->u.fault.fault.ft_flags;
 
 out_err:
-        if (result != 0)
+        if ((result != 0) && !(fault_ret & VM_FAULT_RETRY))
                 fault_ret |= VM_FAULT_ERROR;
 
         vma->vm_flags |= ra_flags;
                 fault_ret |= VM_FAULT_ERROR;
 
         vma->vm_flags |= ra_flags;
index 4d217c9..78e1da7 100644 (file)
@@ -670,6 +670,9 @@ static int vvp_io_kernel_fault(struct vvp_fault_io *cfio)
                 return -ENOMEM;
         }
 
                 return -ENOMEM;
         }
 
+        if (unlikely(cfio->fault.ft_flags & VM_FAULT_RETRY))
+                return -EAGAIN;
+
         CERROR("unknow error in page fault!\n");
         return -EINVAL;
 }
         CERROR("unknow error in page fault!\n");
         return -EINVAL;
 }