[lustre-devel] [PATCH 256/622] lustre: llite: ll_fault fixes

James Simmons jsimmons at infradead.org
Thu Feb 27 13:12:04 PST 2020


From: Patrick Farrell <pfarrell at whamcloud.com>

Various error conditions in the fault path can cause us to
not return a page in vm_fault.  Check if it's present
before accessing it.

WC-bug-id: https://jira.whamcloud.com/browse/LU-11403
Lustre-commit: a8f4d1e5fd79 ("LU-11403 llite: ll_fault fixes")
Signed-off-by: Patrick Farrell <pfarrell at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34247
Reviewed-by: Alex Zhuravlev <bzzz at whamcloud.com>
Reviewed-by: Alexander Zarochentsev <c17826 at cray.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/llite_mmap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/llite/llite_mmap.c b/fs/lustre/llite/llite_mmap.c
index 236d1d2..37ce508 100644
--- a/fs/lustre/llite/llite_mmap.c
+++ b/fs/lustre/llite/llite_mmap.c
@@ -378,7 +378,8 @@ static vm_fault_t ll_fault(struct vm_fault *vmf)
 		return VM_FAULT_SIGBUS;
 restart:
 	result = __ll_fault(vmf->vma, vmf);
-	if (!(result & (VM_FAULT_RETRY | VM_FAULT_ERROR | VM_FAULT_LOCKED))) {
+	if (vmf->page &&
+	    !(result & (VM_FAULT_RETRY | VM_FAULT_ERROR | VM_FAULT_LOCKED))) {
 		struct page *vmpage = vmf->page;
 
 		/* check if this page has been truncated */
-- 
1.8.3.1



More information about the lustre-devel mailing list