File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2022,16 +2022,14 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf)
2022
2022
shmem_falloc -> waitq &&
2023
2023
vmf -> pgoff >= shmem_falloc -> start &&
2024
2024
vmf -> pgoff < shmem_falloc -> next ) {
2025
+ struct file * fpin ;
2025
2026
wait_queue_head_t * shmem_falloc_waitq ;
2026
2027
DEFINE_WAIT_FUNC (shmem_fault_wait , synchronous_wake_function );
2027
2028
2028
2029
ret = VM_FAULT_NOPAGE ;
2029
- if ((vmf -> flags & FAULT_FLAG_ALLOW_RETRY ) &&
2030
- !(vmf -> flags & FAULT_FLAG_RETRY_NOWAIT )) {
2031
- /* It's polite to up mmap_sem if we can */
2032
- up_read (& vma -> vm_mm -> mmap_sem );
2030
+ fpin = maybe_unlock_mmap_for_io (vmf , NULL );
2031
+ if (fpin )
2033
2032
ret = VM_FAULT_RETRY ;
2034
- }
2035
2033
2036
2034
shmem_falloc_waitq = shmem_falloc -> waitq ;
2037
2035
prepare_to_wait (shmem_falloc_waitq , & shmem_fault_wait ,
@@ -2049,6 +2047,9 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf)
2049
2047
spin_lock (& inode -> i_lock );
2050
2048
finish_wait (shmem_falloc_waitq , & shmem_fault_wait );
2051
2049
spin_unlock (& inode -> i_lock );
2050
+
2051
+ if (fpin )
2052
+ fput (fpin );
2052
2053
return ret ;
2053
2054
}
2054
2055
spin_unlock (& inode -> i_lock );
You can’t perform that action at this time.
0 commit comments