mm/hwpoison: disable hwpoison filter during removing
authorzhenwei pi <pizhenwei@bytedance.com>
Fri, 13 May 2022 03:23:10 +0000 (20:23 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 13 May 2022 14:20:19 +0000 (07:20 -0700)
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.

Link: https://lkml.kernel.org/r/20220509105641.491313-5-pizhenwei@bytedance.com
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hwpoison-inject.c

index bb0cea5468cbf76b88d02c9c29ff1ff494625fa8..5c0cddd8150599022768bad2454fc850d82782d6 100644 (file)
@@ -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);
 }