diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-04 16:04:00 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-04 16:04:00 -0800 |
| commit | b20624608f350c5dadd74577629e90715d351e2c (patch) | |
| tree | 16d62704de1ec2959ad35dc2f0b3c20248979a46 /mm | |
| parent | f14faaf3a1fb3b9e4cf2e56269711fb85fba9458 (diff) | |
| parent | 1a47837bfafed7e9ef93f5dfdea6d70869b0c3ab (diff) | |
| download | linux-next-b20624608f350c5dadd74577629e90715d351e2c.tar.gz linux-next-b20624608f350c5dadd74577629e90715d351e2c.zip | |
Merge tag 'mm-hotfixes-stable-2026-02-04-15-55' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton:
"Five hotfixes. Two are cc:stable, two are for MM.
All are singletons - please see the changelogs for details"
* tag 'mm-hotfixes-stable-2026-02-04-15-55' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
Documentation: document liveupdate cmdline parameter
mm, shmem: prevent infinite loop on truncate race
mailmap: update Alexander Mikhalitsyn's emails
liveupdate: luo_file: do not clear serialized_data on unfreeze
x86/kfence: fix booting on 32bit non-PAE systems
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/shmem.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 6c3485d24d66..79af5f9f8b90 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1211,17 +1211,22 @@ whole_folios: swaps_freed = shmem_free_swap(mapping, indices[i], end - 1, folio); if (!swaps_freed) { - /* - * If found a large swap entry cross the end border, - * skip it as the truncate_inode_partial_folio above - * should have at least zerod its content once. - */ + pgoff_t base = indices[i]; + order = shmem_confirm_swap(mapping, indices[i], radix_to_swp_entry(folio)); - if (order > 0 && indices[i] + (1 << order) > end) - continue; - /* Swap was replaced by page: retry */ - index = indices[i]; + /* + * If found a large swap entry cross the end or start + * border, skip it as the truncate_inode_partial_folio + * above should have at least zerod its content once. + */ + if (order > 0) { + base = round_down(base, 1 << order); + if (base < start || base + (1 << order) > end) + continue; + } + /* Swap was replaced by page or extended, retry */ + index = base; break; } nr_swaps_freed += swaps_freed; |
