The patch titled Subject: shmem: update folio if shmem_replace_page() updates the page has been added to the -mm mm-hotfixes-unstable branch. Its filename is shmem-update-folio-if-shmem_replace_page-updates-the-page.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/shmem-update-folio-if-shmem_replace_page-updates-the-page.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 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 via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> Subject: shmem: update folio if shmem_replace_page() updates the page Date: Sat, 30 Jul 2022 05:25:18 +0100 If we allocate a new page, we need to make sure that our folio matches that new page. This will be solved by changing shmem_replace_page() to shmem_replace_folio(), but this is the minimal fix. Link: https://lkml.kernel.org/r/20220730042518.1264767-1-willy@xxxxxxxxxxxxx Fixes: da08e9b79323 ("mm/shmem: convert shmem_swapin_page() to shmem_swapin_folio()") Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/shmem.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/shmem.c~shmem-update-folio-if-shmem_replace_page-updates-the-page +++ a/mm/shmem.c @@ -1771,6 +1771,7 @@ static int shmem_swapin_folio(struct ino if (shmem_should_replace_folio(folio, gfp)) { error = shmem_replace_page(&page, gfp, info, index); + folio = page_folio(page); if (error) goto failed; } _ Patches currently in -mm which might be from willy@xxxxxxxxxxxxx are shmem-update-folio-if-shmem_replace_page-updates-the-page.patch