mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 21:35:07 +00:00
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>
This commit is contained in:
parent
7e2fca52ef
commit
0790e1e2b1
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user