Skip to content

Commit

Permalink
mm: allow fault_dirty_shared_page() to be called under the VMA lock
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reported-by: David Hildenbrand <[email protected]>
Tested-by: Suren Baghdasaryan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Aug 21, 2023
1 parent 7e2fca5 commit 0790e1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0790e1e

Please sign in to comment.