]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm-introduce-do_shared_fault-and-drop-do_fault-fix-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 24 Apr 2014 22:55:40 +0000 (08:55 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 24 Apr 2014 22:55:40 +0000 (08:55 +1000)
add comment which may not be true :(

Cc: Andi Kleen <ak@linux.intel.com>
Cc: Bob Liu <lliubbo@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c

index 71ed335acfabc5d24ebf83c3e32e1d409f9de24b..b6306f24c0d25b7190955a263e60ca14c0de6460 100644 (file)
@@ -3610,6 +3610,12 @@ static int do_shared_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 
        if (set_page_dirty(fault_page))
                dirtied = 1;
+       /*
+        * Take a local copy of the address_space - page.mapping may be zeroed
+        * by truncate after unlock_page().   The address_space itself remains
+        * pinned by vma->vm_file's reference.  We rely on unlock_page()'s
+        * release semantics to prevent the compiler from undoing this copying.
+        */
        mapping = fault_page->mapping;
        unlock_page(fault_page);
        if ((dirtied || vma->vm_ops->page_mkwrite) && mapping) {