]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm, swap: fix reclaim offset calculation error during allocation
authorKairui Song <kasong@tencent.com>
Thu, 30 Jan 2025 11:51:31 +0000 (19:51 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 1 Feb 2025 11:53:26 +0000 (03:53 -0800)
commit498c48c66eb600535f1221652509eefb2dce7770
tree8b89b109d7c8be8e504c300e76e24e6b8450c59b
parent1ccae30ecd98671325fa6954f9934bad298b56a2
mm, swap: fix reclaim offset calculation error during allocation

There is a code error that will cause the swap entry allocator to reclaim
and check the whole cluster with an unexpected tail offset instead of the
part that needs to be reclaimed.  This may cause corruption of the swap
map, so fix it.

Link: https://lkml.kernel.org/r/20250130115131.37777-1-ryncsn@gmail.com
Fixes: 3b644773eefd ("mm, swap: reduce contention on device lock")
Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: Chris Li <chrisl@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swapfile.c