提交 89e428d3 编写于 作者: M Ma Wupeng 提交者: Yang Yingliang

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: 851a3ff0 ("mm: Introduce proc interface to control memory reliable features")
Signed-off-by: NMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 584279e2
...@@ -275,10 +275,8 @@ static void mem_reliable_parse_ctrl_bits(unsigned long ctrl_bits) ...@@ -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++) { for (i = MEM_RELIABLE_FALLBACK; i < MEM_RELIABLE_MAX; i++) {
status = !!test_bit(i, &ctrl_bits); status = !!test_bit(i, &ctrl_bits);
if (mem_reliable_ctrl_bit_is_enabled(i) ^ status) { if (mem_reliable_ctrl_bit_is_enabled(i) ^ status)
mem_reliable_ctrl_bit_set(i, status);
mem_reliable_feature_set(i, status); mem_reliable_feature_set(i, status);
}
} }
} }
...@@ -484,6 +482,8 @@ static int __init reliable_sysctl_init(void) ...@@ -484,6 +482,8 @@ static int __init reliable_sysctl_init(void)
return 0; return 0;
} }
late_initcall(reliable_sysctl_init); late_initcall(reliable_sysctl_init);
#else
static void mem_reliable_ctrl_bit_set(int idx, bool enable) {}
#endif #endif
static void mem_reliable_feature_set(int idx, bool enable) static void mem_reliable_feature_set(int idx, bool enable)
...@@ -508,6 +508,7 @@ 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; return;
} }
mem_reliable_ctrl_bit_set(idx, enable);
pr_info("%s is %s\n", str, enable ? "enabled" : "disabled"); pr_info("%s is %s\n", str, enable ? "enabled" : "disabled");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册