diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2009-12-16 06:19:59 -0500 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2009-12-16 06:19:59 -0500 |
commit | 7c116f2b0dbac4a1dd051c7a5e8cef37701cafd4 (patch) | |
tree | ac7f1e56551df46bc79e400a182a57f4eae5ddaf /mm/hwpoison-inject.c | |
parent | 138ce286eb6ee6d39ca4fb50516e93adaf6b605f (diff) |
HWPOISON: add fs/device filters
Filesystem data/metadata present the most tricky-to-isolate pages.
It requires careful code review and stress testing to get them right.
The fs/device filter helps to target the stress tests to some specific
filesystem pages. The filter condition is block device's major/minor
numbers:
- corrupt-filter-dev-major
- corrupt-filter-dev-minor
When specified (non -1), only page cache pages that belong to that
device will be poisoned.
The filters are checked reliably on the locked and refcounted page.
Haicheng: clear PG_hwpoison and drop bad page count if filter not OK
AK: Add documentation
CC: Haicheng Li <haicheng.li@intel.com>
CC: Nick Piggin <npiggin@suse.de>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/hwpoison-inject.c')
-rw-r--r-- | mm/hwpoison-inject.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c index 6e35e563bf50..ac692a9b766c 100644 --- a/mm/hwpoison-inject.c +++ b/mm/hwpoison-inject.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/debugfs.h> | 3 | #include <linux/debugfs.h> |
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | #include "internal.h" | ||
6 | 7 | ||
7 | static struct dentry *hwpoison_dir; | 8 | static struct dentry *hwpoison_dir; |
8 | 9 | ||
@@ -54,6 +55,16 @@ static int pfn_inject_init(void) | |||
54 | if (!dentry) | 55 | if (!dentry) |
55 | goto fail; | 56 | goto fail; |
56 | 57 | ||
58 | dentry = debugfs_create_u32("corrupt-filter-dev-major", 0600, | ||
59 | hwpoison_dir, &hwpoison_filter_dev_major); | ||
60 | if (!dentry) | ||
61 | goto fail; | ||
62 | |||
63 | dentry = debugfs_create_u32("corrupt-filter-dev-minor", 0600, | ||
64 | hwpoison_dir, &hwpoison_filter_dev_minor); | ||
65 | if (!dentry) | ||
66 | goto fail; | ||
67 | |||
57 | return 0; | 68 | return 0; |
58 | fail: | 69 | fail: |
59 | pfn_inject_exit(); | 70 | pfn_inject_exit(); |