From 0e5e44ee7e309ccc45985d78452bedec2b2d45f0 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Wed, 22 Jun 2011 12:14:15 +0800 Subject: [PATCH] LU-435 Add VM_FAULT_RETRY handling 2.6.32 kernel add VM_FAULT_RETRY option in handle page fault, we need handle it as well. Signed-off-by: Bobi Jam Change-Id: I71d1c51bc297d1e0e8cc38e11b8a724edf9d1ae7 Reviewed-on: http://review.whamcloud.com/997 Tested-by: Hudson Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin --- lustre/llite/llite_internal.h | 4 ++++ lustre/llite/llite_mmap.c | 2 +- lustre/llite/vvp_io.c | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 6411381..a9fdab1 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -52,6 +52,10 @@ #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 diff --git a/lustre/llite/llite_mmap.c b/lustre/llite/llite_mmap.c index 39d3756..81ee3fb 100644 --- a/lustre/llite/llite_mmap.c +++ b/lustre/llite/llite_mmap.c @@ -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: - if (result != 0) + if ((result != 0) && !(fault_ret & VM_FAULT_RETRY)) fault_ret |= VM_FAULT_ERROR; vma->vm_flags |= ra_flags; diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index 4d217c9..78e1da7 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -670,6 +670,9 @@ static int vvp_io_kernel_fault(struct vvp_fault_io *cfio) return -ENOMEM; } + if (unlikely(cfio->fault.ft_flags & VM_FAULT_RETRY)) + return -EAGAIN; + CERROR("unknow error in page fault!\n"); return -EINVAL; } -- 1.8.3.1