提交 52a2b53f 编写于 作者: K Kirill A. Shutemov 提交者: Linus Torvalds

mm, dax: use i_mmap_unlock_write() in do_cow_fault()

__dax_fault() takes i_mmap_lock for write. Let's pair it with write
unlock on do_cow_fault() side.
Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: NMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 46c043ed
...@@ -3013,9 +3013,9 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -3013,9 +3013,9 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
} else { } else {
/* /*
* The fault handler has no page to lock, so it holds * The fault handler has no page to lock, so it holds
* i_mmap_lock for read to protect against truncate. * i_mmap_lock for write to protect against truncate.
*/ */
i_mmap_unlock_read(vma->vm_file->f_mapping); i_mmap_unlock_write(vma->vm_file->f_mapping);
} }
goto uncharge_out; goto uncharge_out;
} }
...@@ -3029,9 +3029,9 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -3029,9 +3029,9 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
} else { } else {
/* /*
* The fault handler has no page to lock, so it holds * The fault handler has no page to lock, so it holds
* i_mmap_lock for read to protect against truncate. * i_mmap_lock for write to protect against truncate.
*/ */
i_mmap_unlock_read(vma->vm_file->f_mapping); i_mmap_unlock_write(vma->vm_file->f_mapping);
} }
return ret; return ret;
uncharge_out: uncharge_out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册