aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/mmap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 5d09d08a4120..32a287b631d4 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2358,11 +2358,17 @@ int mm_take_all_locks(struct mm_struct *mm)
2358 for (vma = mm->mmap; vma; vma = vma->vm_next) { 2358 for (vma = mm->mmap; vma; vma = vma->vm_next) {
2359 if (signal_pending(current)) 2359 if (signal_pending(current))
2360 goto out_unlock; 2360 goto out_unlock;
2361 if (vma->anon_vma)
2362 vm_lock_anon_vma(mm, vma->anon_vma);
2363 if (vma->vm_file && vma->vm_file->f_mapping) 2361 if (vma->vm_file && vma->vm_file->f_mapping)
2364 vm_lock_mapping(mm, vma->vm_file->f_mapping); 2362 vm_lock_mapping(mm, vma->vm_file->f_mapping);
2365 } 2363 }
2364
2365 for (vma = mm->mmap; vma; vma = vma->vm_next) {
2366 if (signal_pending(current))
2367 goto out_unlock;
2368 if (vma->anon_vma)
2369 vm_lock_anon_vma(mm, vma->anon_vma);
2370 }
2371
2366 ret = 0; 2372 ret = 0;
2367 2373
2368out_unlock: 2374out_unlock: