]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Clear page->private when splitting or migrating a page
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 19 Jun 2022 14:37:32 +0000 (10:37 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 23 Jun 2022 16:21:44 +0000 (12:21 -0400)
commita1d8506fb82459ad6a80f3826c6d1bd7428a46a6
treecb4f733ccff7026b5cd4eaa3220e282bcd90a07a
parentc96ac429555a12df813079176c30d1c8323b5db9
mm: Clear page->private when splitting or migrating a page

In our efforts to remove uses of PG_private, we have found folios with
the private flag clear and folio->private not-NULL.  That is the root
cause behind a796251487c4 ("ceph: check folio PG_private bit instead
of folio->private").  It can also affect a few other filesystems that
haven't yet reported a problem.

compaction_alloc() can return a page with uninitialised page->private,
and rather than checking all the callers of migrate_pages(), just zero
page->private after calling get_new_page().  Similarly, the tail pages
from split_huge_page() may also have an uninitialised page->private.

Reported-by: Xiubo Li <xiubli@redhat.com>
Tested-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/huge_memory.c
mm/migrate.c