Skip to content

Commit

Permalink
HWPOISON: Don't do early filtering if filter is disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Andi Kleen <ak@linux.intel.com>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Dec 16, 2009
1 parent afcf938 commit 0d57eb8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/hwpoison-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 0d57eb8

Please sign in to comment.