From 4d9d866fe52c579a423be7c9d0dda2d4790ec7ee Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Mon, 13 Sep 2021 16:27:10 +0530 Subject: [PATCH] ANDROID: mm: unlock the page on speculative fault retry It is observed that certain file accesses are failing when speculative file faults are enabled via "allow_file_spec_access". This is because of not unlocking the page on error in filemap_map_pages, and the locked page causes endless retry of fault. Bug: 199706590 Fixes: 35eacb5c87b9 ("ANDROID: mm: allow vmas with vm_ops to be speculatively handled") Change-Id: Ic7643ea8188aa281754318866fde09eea094c5da Signed-off-by: Vinayak Menon --- mm/filemap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/filemap.c b/mm/filemap.c index d60dd67000fb..632734e9f8f1 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2996,6 +2996,8 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, addr = vma->vm_start + ((start_pgoff - vma->vm_pgoff) << PAGE_SHIFT); if (!pte_map_lock_addr(vmf, addr)) { + unlock_page(head); + put_page(head); ret = VM_FAULT_RETRY; goto out; }