public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.12.y 0/4] mm/shmem, swap: overdue shmem_swapin_folio() fixes
@ 2026-03-23  9:29 Hugh Dickins
  2026-03-23  9:34 ` [PATCH 6.12.y 1/4] mm: shmem: fix potential data corruption during shmem swapin Hugh Dickins
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Hugh Dickins @ 2026-03-23  9:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andrew Morton, Baolin Wang, Baoquan He, Barry Song, Chris Li,
	David Hildenbrand, Dev Jain, Greg Thelen, Guenter Roeck,
	Hugh Dickins, Kairui Song, Kemeng Shi, Lance Yang, Matthew Wilcox,
	Nhat Pham, linux-mm, stable

Greg Thelen (assisted by Gemini) has observed that 6.12.69 commit
a99f9a4669a0 ("mm/shmem, swap: fix race of truncate and swap entry split")
and its followup
dfc3ab6bd648 ("mm, shmem: prevent infinite loop on truncate race")
both rely on shmem_confirm_swap() to be returning int order or -1,
whereas in the 6.12.78-rc tree it is still returning bool 0 or 1.

Quite what the effect of that is, I've not tried to work out: luckily,
it's on an unlikely path which most of us find difficult to reproduce;
but better be fixed!

And applying the Stable-dep which made that change from bool to int order
reminds me of two "Cc stable" fixes from last year (and a followup fix to
one of them), which never got applied to the 6.12.y shmem_swapin_folio()
because of intervening mods.  Aside from minimizing the rejects, there
is little point in holding that "truncate and swap entry split" fix
without the more basic shmem swap order fixes found much earlier.

My own poor testing hit none of these issues: I hope others can verify.

1/4 mm: shmem: fix potential data corruption during shmem swapin
2/4 mm: shmem: avoid unpaired folio_unlock() in shmem_swapin_folio()
3/4 mm/shmem, swap: improve cached mTHP handling and fix potential hang
4/4 mm/shmem, swap: avoid redundant Xarray lookup during swapin

 mm/shmem.c | 97 ++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 80 insertions(+), 17 deletions(-)

Thanks,
Hugh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-23  9:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23  9:29 [PATCH 6.12.y 0/4] mm/shmem, swap: overdue shmem_swapin_folio() fixes Hugh Dickins
2026-03-23  9:34 ` [PATCH 6.12.y 1/4] mm: shmem: fix potential data corruption during shmem swapin Hugh Dickins
2026-03-23  9:37 ` [PATCH 6.12.y 2/4] mm: shmem: avoid unpaired folio_unlock() in shmem_swapin_folio() Hugh Dickins
2026-03-23  9:40 ` [PATCH 6.12.y 3/4] mm/shmem, swap: improve cached mTHP handling and fix potential hang Hugh Dickins
2026-03-23  9:43 ` [PATCH 6.12.y 4/4] mm/shmem, swap: avoid redundant Xarray lookup during swapin Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox