+ filemap-check-compound_headpage-mapping-in-pagecache_get_page.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: filemap: check compound_head(page)->mapping in pagecache_get_page()
has been added to the -mm tree.  Its filename is
     filemap-check-compound_headpage-mapping-in-pagecache_get_page.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/filemap-check-compound_headpage-mapping-in-pagecache_get_page.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/filemap-check-compound_headpage-mapping-in-pagecache_get_page.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Song Liu <songliubraving@xxxxxx>
Subject: filemap: check compound_head(page)->mapping in pagecache_get_page()

Similar to previous patch, pagecache_get_page() avoids race condition with
truncate by checking page->mapping == mapping.  This does not work for
compound pages.  This patch let it check compound_head(page)->mapping
instead.

Link: http://lkml.kernel.org/r/20190801184244.3169074-3-songliubraving@xxxxxx
Signed-off-by: Song Liu <songliubraving@xxxxxx>
Suggested-by: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Hillf Danton <hdanton@xxxxxxxx>
Cc: Hugh Dickins <hughd@xxxxxxxxxx>
Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
Cc: Rik van Riel <riel@xxxxxxxxxxx>
Cc: William Kucharski <william.kucharski@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/filemap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/filemap.c~filemap-check-compound_headpage-mapping-in-pagecache_get_page
+++ a/mm/filemap.c
@@ -1648,7 +1648,7 @@ repeat:
 		}
 
 		/* Has the page been truncated? */
-		if (unlikely(page->mapping != mapping)) {
+		if (unlikely(compound_head(page)->mapping != mapping)) {
 			unlock_page(page);
 			put_page(page);
 			goto repeat;
_

Patches currently in -mm which might be from songliubraving@xxxxxx are

mm-move-memcmp_pages-and-pages_identical.patch
uprobe-use-original-page-when-all-uprobes-are-removed.patch
uprobe-use-original-page-when-all-uprobes-are-removed-v2.patch
mm-thp-introduce-foll_split_pmd.patch
mm-thp-introduce-foll_split_pmd-v11.patch
uprobe-use-foll_split_pmd-instead-of-foll_split.patch
khugepaged-enable-collapse-pmd-for-pte-mapped-thp.patch
uprobe-collapse-thp-pmd-after-removing-all-uprobes.patch
filemap-check-compound_headpage-mapping-in-filemap_fault.patch
filemap-check-compound_headpage-mapping-in-pagecache_get_page.patch
filemap-update-offset-check-in-filemap_fault.patch
mmthp-stats-for-file-backed-thp.patch
khugepaged-rename-collapse_shmem-and-khugepaged_scan_shmem.patch
mmthp-add-read-only-thp-support-for-non-shmem-fs.patch
mmthp-avoid-writes-to-file-with-thp-in-pagecache.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux