提交 0d57eb8d 编写于 作者: A Andi Kleen 提交者: Andi Kleen

HWPOISON: Don't do early filtering if filter is disabled

Signed-off-by: NAndi Kleen <ak@linux.intel.com>
上级 afcf938e
...@@ -18,6 +18,8 @@ static int hwpoison_inject(void *data, u64 val) ...@@ -18,6 +18,8 @@ static int hwpoison_inject(void *data, u64 val)
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (!hwpoison_filter_enable)
goto inject;
if (!pfn_valid(pfn)) if (!pfn_valid(pfn))
return -ENXIO; return -ENXIO;
...@@ -48,6 +50,7 @@ static int hwpoison_inject(void *data, u64 val) ...@@ -48,6 +50,7 @@ static int hwpoison_inject(void *data, u64 val)
if (err) if (err)
return 0; return 0;
inject:
printk(KERN_INFO "Injecting memory failure at pfn %lx\n", pfn); printk(KERN_INFO "Injecting memory failure at pfn %lx\n", pfn);
return __memory_failure(pfn, 18, MF_COUNT_INCREASED); return __memory_failure(pfn, 18, MF_COUNT_INCREASED);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册