|
@@ -1478,7 +1478,7 @@ static void mlx5_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
|
|
/* need to protect from a race on closing the vma as part of
|
|
/* need to protect from a race on closing the vma as part of
|
|
* mlx5_ib_vma_close.
|
|
* mlx5_ib_vma_close.
|
|
*/
|
|
*/
|
|
- down_read(&owning_mm->mmap_sem);
|
|
|
|
|
|
+ down_write(&owning_mm->mmap_sem);
|
|
list_for_each_entry_safe(vma_private, n, &context->vma_private_list,
|
|
list_for_each_entry_safe(vma_private, n, &context->vma_private_list,
|
|
list) {
|
|
list) {
|
|
vma = vma_private->vma;
|
|
vma = vma_private->vma;
|
|
@@ -1492,7 +1492,7 @@ static void mlx5_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
|
|
list_del(&vma_private->list);
|
|
list_del(&vma_private->list);
|
|
kfree(vma_private);
|
|
kfree(vma_private);
|
|
}
|
|
}
|
|
- up_read(&owning_mm->mmap_sem);
|
|
|
|
|
|
+ up_write(&owning_mm->mmap_sem);
|
|
mmput(owning_mm);
|
|
mmput(owning_mm);
|
|
put_task_struct(owning_process);
|
|
put_task_struct(owning_process);
|
|
}
|
|
}
|