]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm, dax: use i_mmap_unlock_write() in do_cow_fault()
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tue, 8 Sep 2015 21:59:45 +0000 (14:59 -0700)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:51 +0000 (12:19 -0500)
Orabug: 22913653

__dax_fault() takes i_mmap_lock for write. Let's pair it with write
unlock on do_cow_fault() side.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 52a2b53ffde6d6018dfc454fbde34383351fb896)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
mm/memory.c

index af2df84275bc7e1e380b9ac04b550c4468efa608..28d19905ebe48344c506307c6cd7b541541fcad4 100644 (file)
@@ -2995,9 +2995,9 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
                } else {
                        /*
                         * 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;
        }
@@ -3011,9 +3011,9 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        } else {
                /*
                 * 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;
 uncharge_out: