mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
HWPOISON: Don't do early filtering if filter is disabled
Signed-off-by: Andi Kleen <ak@linux.intel.com>
This commit is contained in:
parent
afcf938ee0
commit
0d57eb8dfc
@ -18,6 +18,8 @@ static int hwpoison_inject(void *data, u64 val)
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
if (!hwpoison_filter_enable)
|
||||
goto inject;
|
||||
if (!pfn_valid(pfn))
|
||||
return -ENXIO;
|
||||
|
||||
@ -48,6 +50,7 @@ static int hwpoison_inject(void *data, u64 val)
|
||||
if (err)
|
||||
return 0;
|
||||
|
||||
inject:
|
||||
printk(KERN_INFO "Injecting memory failure at pfn %lx\n", pfn);
|
||||
return __memory_failure(pfn, 18, MF_COUNT_INCREASED);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user