The patch titled Subject: mm: swap: fix array-bounds error with CONFIG_THP_SWAP=n has been added to the -mm mm-unstable branch. Its filename is mm-swap-separate-ssd-allocation-from-scan_swap_map_slots-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-swap-separate-ssd-allocation-from-scan_swap_map_slots-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Kairui Song <ryncsn@xxxxxxxxx> Subject: mm: swap: fix array-bounds error with CONFIG_THP_SWAP=n Date: Mon, 19 Aug 2024 19:44:25 +0800 Link: https://lkml.kernel.org/r/CAMgjq7Bz0DY+rY0XgCoH7-Q=uHLdo3omi8kUr4ePDweNyofsbQ@xxxxxxxxxxxxxx Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx> Reported-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx> Closes: https://lkml.kernel.org/r/CA+G9fYuFDon59=Nw6WCdgp0FanZ1oE3dCkoq71EK0Bxe6Jhe_g@xxxxxxxxxxxxxx Tested-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx> Cc: Anders Roxell <anders.roxell@xxxxxxxxxx> Cc: Barry Song <21cnbao@xxxxxxxxx> Cc: Chris Li <chrisl@xxxxxxxxxx> Cc: "Huang, Ying" <ying.huang@xxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Kalesh Singh <kaleshsingh@xxxxxxxxxx> Cc: Ryan Roberts <ryan.roberts@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/swapfile.c~mm-swap-separate-ssd-allocation-from-scan_swap_map_slots-fix +++ a/mm/swapfile.c @@ -659,7 +659,7 @@ new_cluster: if (order) goto done; - for (int o = 1; o < PMD_ORDER; o++) { + for (int o = 1; o < SWAP_NR_ORDERS; o++) { if (!list_empty(&si->nonfull_clusters[o])) { ci = list_first_entry(&si->nonfull_clusters[o], struct swap_cluster_info, list); _ Patches currently in -mm which might be from ryncsn@xxxxxxxxx are mm-swap-separate-ssd-allocation-from-scan_swap_map_slots-fix.patch mm-swap-add-a-adaptive-full-cluster-cache-reclaim-fix.patch