mm: release mutex before handle_mm_fault
Krishna Reddy [Tue, 9 Feb 2016 22:17:45 +0000 (14:17 -0800)]
Release mutex before handle_mm_fault for filemap faults and
reacquire it.

Bug 200172417

Change-Id: I1df9d3529dde9d739e9ba44108edc0fb1e582fa8
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/1012132
Tested-by: Eric Miao <emiao@nvidia.com>
Reviewed-by: Eric Miao <emiao@nvidia.com>
Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>

mm/memory.c

index 56dd745..8e70cb1 100644 (file)
@@ -1890,8 +1890,12 @@ follow_page_again:
                                if (foll_flags & FOLL_NOWAIT)
                                        fault_flags |= (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT);
 
+                               if (vma->vm_file)
+                                       mutex_unlock(&s_follow_page_lock);
                                ret = handle_mm_fault(mm, vma, start,
                                                        fault_flags);
+                               if (vma->vm_file)
+                                       mutex_lock(&s_follow_page_lock);
 
                                if (ret & VM_FAULT_ERROR) {
                                        mutex_unlock(&s_follow_page_lock);