[PATCH v2 4/5] mm/hwpoison: disable hwpoison filter during removing

From: zhenwei pi
Date: Mon May 09 2022 - 07:01:44 EST


hwpoison filter is enabled by hwpoison-inject module, after removing
this module, hwpoison filter still works. What is worse, user can not
find the debugfs entries to know this.

Disable the hwpoison filter during removing hwpoison-inject module.

Signed-off-by: zhenwei pi <pizhenwei@xxxxxxxxxxxxx>
---
mm/hwpoison-inject.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
index bb0cea5468cb..5c0cddd81505 100644
--- a/mm/hwpoison-inject.c
+++ b/mm/hwpoison-inject.c
@@ -65,6 +65,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(unpoison_fops, NULL, hwpoison_unpoison, "%lli\n");

static void pfn_inject_exit(void)
{
+ hwpoison_filter_enable = 0;
debugfs_remove_recursive(hwpoison_dir);
}

--
2.20.1