lkml.org 
[lkml]   [2022]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] shmem: Update folio if shmem_replace_page() updates the page
Date
Looks good.

Reviewed-by: William Kucharski <william.kucharski@oracle.com>


> On Jul 29, 2022, at 10:25 PM, Matthew Wilcox (Oracle) <willy@infradead.org> wrote:
>
> 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.
>
> Fixes: da08e9b79323 ("mm/shmem: convert shmem_swapin_page() to shmem_swapin_folio()")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> mm/shmem.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index a6f565308133..bcc0a3c7b5bf 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -1771,6 +1771,7 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index,
>
> if (shmem_should_replace_folio(folio, gfp)) {
> error = shmem_replace_page(&page, gfp, info, index);
> + folio = page_folio(page);
> if (error)
> goto failed;
> }
> --
> 2.35.1

\
 
 \ /
  Last update: 2022-08-05 22:59    [W:0.080 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site