From: Ma Wupeng mawupeng1@huawei.com
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 mawupeng1@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- 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 ae4e9609f43cf..7ce97184e08ec 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"); }