From 89e428d33f6513399bae330b976fff8ed5915d57 Mon Sep 17 00:00:00 2001 From: Ma Wupeng Date: Fri, 4 Mar 2022 11:41:15 +0800 Subject: [PATCH] mm: Fix reliable_debug in proc not consistent with boot parameter problem hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA -------------------------------- Now reliable_debug will be consistent with boot parameter. If reliable_debug in boot parameter is set t "F", reliable_debug in proc will be 13 which means only fallback is closed. Fixes: 851a3ff0b4de ("mm: Introduce proc interface to control memory reliable features") Signed-off-by: Ma Wupeng Reviewed-by: Kefeng Wang Signed-off-by: Yang Yingliang --- mm/mem_reliable.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/mem_reliable.c b/mm/mem_reliable.c index ae4e9609f43c..7ce97184e08e 100644 --- a/mm/mem_reliable.c +++ b/mm/mem_reliable.c @@ -275,10 +275,8 @@ static void mem_reliable_parse_ctrl_bits(unsigned long ctrl_bits) for (i = MEM_RELIABLE_FALLBACK; i < MEM_RELIABLE_MAX; i++) { status = !!test_bit(i, &ctrl_bits); - if (mem_reliable_ctrl_bit_is_enabled(i) ^ status) { - mem_reliable_ctrl_bit_set(i, status); + if (mem_reliable_ctrl_bit_is_enabled(i) ^ status) mem_reliable_feature_set(i, status); - } } } @@ -484,6 +482,8 @@ static int __init reliable_sysctl_init(void) return 0; } late_initcall(reliable_sysctl_init); +#else +static void mem_reliable_ctrl_bit_set(int idx, bool enable) {} #endif static void mem_reliable_feature_set(int idx, bool enable) @@ -508,6 +508,7 @@ static void mem_reliable_feature_set(int idx, bool enable) return; } + mem_reliable_ctrl_bit_set(idx, enable); pr_info("%s is %s\n", str, enable ? "enabled" : "disabled"); } -- GitLab