summaryrefslogtreecommitdiffstats
path: root/mm/internal.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2023-08-12 02:20:33 +0200
committerAndrew Morton <akpm@linux-foundation.org>2023-08-21 22:38:02 +0200
commit0790e1e2b1b71ba357e89e779451efe79dff28e6 (patch)
tree2d7f981cfd7cc31641e0e8f697acd62cb5b303ec /mm/internal.h
parentmm/secretmem: use a folio in secretmem_fault() (diff)
downloadlinux-0790e1e2b1b71ba357e89e779451efe79dff28e6.tar.xz
linux-0790e1e2b1b71ba357e89e779451efe79dff28e6.zip
mm: allow fault_dirty_shared_page() to be called under the VMA lock
By making maybe_unlock_mmap_for_io() handle the VMA lock correctly, we make fault_dirty_shared_page() safe to be called without the mmap lock held. Link: https://lkml.kernel.org/r/20230812002033.1002367-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reported-by: David Hildenbrand <david@redhat.com> Tested-by: Suren Baghdasaryan <surenb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/internal.h')
-rw-r--r--mm/internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/internal.h b/mm/internal.h
index a037b1b37f6d..c6ed10f0a5ad 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -706,7 +706,7 @@ static inline struct file *maybe_unlock_mmap_for_io(struct vm_fault *vmf,
if (fault_flag_allow_retry_first(flags) &&
!(flags & FAULT_FLAG_RETRY_NOWAIT)) {
fpin = get_file(vmf->vma->vm_file);
- mmap_read_unlock(vmf->vma->vm_mm);
+ release_fault_lock(vmf);
}
return fpin;
}