[PATCH] [25/31] HWPOISON: Don't do early filtering if filter is disabled

From: Andi Kleen
Date: Tue Dec 08 2009 - 16:19:02 EST



Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

---
mm/hwpoison-inject.c | 3 +++
1 file changed, 3 insertions(+)

Index: linux/mm/hwpoison-inject.c
===================================================================
--- linux.orig/mm/hwpoison-inject.c
+++ linux/mm/hwpoison-inject.c
@@ -18,6 +18,8 @@ static int hwpoison_inject(void *data, u
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, u
if (err)
return 0;

+inject:
printk(KERN_INFO "Injecting memory failure at pfn %lx\n", pfn);
return __memory_failure(pfn, 18, MF_COUNT_INCREASED);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/