mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Hugh Dickins <hughd@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: [PATCH] shmem: Update folio if shmem_replace_page() updates the page
Date: Wed, 10 Aug 2022 09:03:37 -0700 (PDT)	[thread overview]
Message-ID: <9ec4de13-3f7-ba55-924-75d825ec12ed@google.com> (raw)
In-Reply-To: <20220730042518.1264767-1-willy@infradead.org>

On Sat, 30 Jul 2022, Matthew Wilcox (Oracle) 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>

Acked-by: Hugh Dickins <hughd@google.com>

I hit this myself just once, at about the very time you sent the fix.
But, thinking that shmem_replace_page() was special for gma500, couldn't
understand how I (or most people) would ever get there.  Turns out that
nowadays tmpfs symlinks longer than 128 can come this way on 32-bit (I
had been testing kmap_local stuff for other reasons).

And today I see that Zdenek hit it on 5.19-rc back in June:
https://lore.kernel.org/lkml/584ae788-05e3-5824-8c85-cbb833677850@redhat.com/
so this patch is definitely one for -stable.

Hugh

> ---
>  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

      parent reply	other threads:[~2022-08-10 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30  4:25 Matthew Wilcox (Oracle)
2022-08-03  0:46 ` Andrew Morton
2022-08-03  3:17   ` Matthew Wilcox
2022-08-05 20:34     ` William Kucharski
2022-08-05 20:52 ` William Kucharski
2022-08-10 16:03 ` Hugh Dickins [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ec4de13-3f7-ba55-924-75d825ec12ed@google.com \
    --to=hughd@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    --cc=zkabelac@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®