Re: [PATCH v4 9/10] mm/hwpoison: change permission of corrupt-pfn/unpoison-pfn to 0400

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 26, 2013 at 04:46:13PM +0800, Wanpeng Li wrote:
>Hwpoison inject doesn't implement read method for corrupt-pfn/unpoison-pfn
>attributes:
>
># cat /sys/kernel/debug/hwpoison/corrupt-pfn 
>cat: /sys/kernel/debug/hwpoison/corrupt-pfn: Permission denied
># cat /sys/kernel/debug/hwpoison/unpoison-pfn 
>cat: /sys/kernel/debug/hwpoison/unpoison-pfn: Permission denied
>
>This patch change the permission of corrupt-pfn/unpoison-pfn to 0400.
>
>Signed-off-by: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>
>---
> mm/hwpoison-inject.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
>index 3a61efc..8b77bfd 100644
>--- a/mm/hwpoison-inject.c
>+++ b/mm/hwpoison-inject.c
>@@ -88,12 +88,12 @@ static int pfn_inject_init(void)
> 	 * hardware status change, hence do not require hardware support.
> 	 * They are mainly for testing hwpoison in software level.
> 	 */
>-	dentry = debugfs_create_file("corrupt-pfn", 0600, hwpoison_dir,
>+	dentry = debugfs_create_file("corrupt-pfn", 0400, hwpoison_dir,
> 					  NULL, &hwpoison_fops);
> 	if (!dentry)
> 		goto fail;
>
>-	dentry = debugfs_create_file("unpoison-pfn", 0600, hwpoison_dir,
>+	dentry = debugfs_create_file("unpoison-pfn", 0400, hwpoison_dir,
> 				     NULL, &unpoison_fops);
> 	if (!dentry)
> 		goto fail;
>-- 
>1.8.1.2

Fix this patch: 



>From 615b965ad33e4a18a8b977243024ef5911d2272c Mon Sep 17 00:00:00 2001
From: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Aug 2013 11:44:50 +0800
Subject: [PATCH v4 9/10] mm/hwpoison: change permission of corrupt-pfn/unpoison-pfn to 0200 

Hwpoison inject doesn't implement read method for corrupt-pfn/unpoison-pfn
attributes:

# cat /sys/kernel/debug/hwpoison/corrupt-pfn 
cat: /sys/kernel/debug/hwpoison/corrupt-pfn: Permission denied
# cat /sys/kernel/debug/hwpoison/unpoison-pfn 
cat: /sys/kernel/debug/hwpoison/unpoison-pfn: Permission denied

This patch change the permission of corrupt-pfn/unpoison-pfn to 0200.

Signed-off-by: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>
---
 mm/hwpoison-inject.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
index 3a61efc..8b77bfd 100644
--- a/mm/hwpoison-inject.c
+++ b/mm/hwpoison-inject.c
@@ -88,12 +88,12 @@ static int pfn_inject_init(void)
 	 * hardware status change, hence do not require hardware support.
 	 * They are mainly for testing hwpoison in software level.
 	 */
-	dentry = debugfs_create_file("corrupt-pfn", 0600, hwpoison_dir,
+	dentry = debugfs_create_file("corrupt-pfn", 0200, hwpoison_dir,
 					  NULL, &hwpoison_fops);
 	if (!dentry)
 		goto fail;
 
-	dentry = debugfs_create_file("unpoison-pfn", 0600, hwpoison_dir,
+	dentry = debugfs_create_file("unpoison-pfn", 0200, hwpoison_dir,
 				     NULL, &unpoison_fops);
 	if (!dentry)
 		goto fail;
-- 
1.8.1.2


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]