From b6cad43ad3cf63d73e539e3eaadd4ec9d2744dc6 Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Fri, 10 Jul 2020 17:27:45 +0800 Subject: [PATCH] dbg: Fix a logic hole in swap_ra_info() --- mm/swap_state.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/swap_state.c b/mm/swap_state.c index 05889e8e3c97..8481c15829b2 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -669,12 +669,11 @@ static void swap_ra_info(struct vm_fault *vmf, pte_t *tpte; #endif + ra_info->win = 1; max_win = 1 << min_t(unsigned int, READ_ONCE(page_cluster), SWAP_RA_ORDER_CEILING); - if (max_win == 1) { - ra_info->win = 1; + if (max_win == 1) return; - } faddr = vmf->address; orig_pte = pte = pte_offset_map(vmf->pmd, faddr); -- 2.27.0