All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mm/memblock.c: return -ENOMEM instead of -ENXIO on failure of debugfs_create_dir in memblock_init_debugfs
@ 2011-11-09  2:01 ` Wang Sheng-Hui
  0 siblings, 0 replies; 4+ messages in thread
From: Wang Sheng-Hui @ 2011-11-09  2:01 UTC (permalink / raw)
  To: yinghai, linux-mm, linux-kernel

On the failure of debugfs_create_dir, we should return -ENOMEM
instead of -ENXIO.

The patch is against 3.1.


Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
 mm/memblock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index ccbf973..4d4d5ee 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -852,7 +852,7 @@ static int __init memblock_init_debugfs(void)
 {
 	struct dentry *root = debugfs_create_dir("memblock", NULL);
 	if (!root)
-		return -ENXIO;
+		return -ENOMEM;
 	debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
 	debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 1/2] mm/memblock.c: return -ENOMEM instead of -ENXIO on failure of debugfs_create_dir in memblock_init_debugfs
@ 2011-11-09  2:01 ` Wang Sheng-Hui
  0 siblings, 0 replies; 4+ messages in thread
From: Wang Sheng-Hui @ 2011-11-09  2:01 UTC (permalink / raw)
  To: yinghai, linux-mm, linux-kernel

On the failure of debugfs_create_dir, we should return -ENOMEM
instead of -ENXIO.

The patch is against 3.1.


Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
 mm/memblock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index ccbf973..4d4d5ee 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -852,7 +852,7 @@ static int __init memblock_init_debugfs(void)
 {
 	struct dentry *root = debugfs_create_dir("memblock", NULL);
 	if (!root)
-		return -ENXIO;
+		return -ENOMEM;
 	debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
 	debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);
 
-- 
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mm/memblock.c: return -ENOMEM instead of -ENXIO on failure of debugfs_create_dir in memblock_init_debugfs
  2011-11-09  2:01 ` Wang Sheng-Hui
@ 2011-11-22 23:55   ` Andrew Morton
  -1 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2011-11-22 23:55 UTC (permalink / raw)
  To: Wang Sheng-Hui; +Cc: yinghai, linux-mm, linux-kernel

On Wed, 09 Nov 2011 10:01:26 +0800
Wang Sheng-Hui <shhuiw@gmail.com> wrote:

> On the failure of debugfs_create_dir, we should return -ENOMEM
> instead of -ENXIO.
> 
> The patch is against 3.1.
> 
> 
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
>  mm/memblock.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index ccbf973..4d4d5ee 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -852,7 +852,7 @@ static int __init memblock_init_debugfs(void)
>  {
>  	struct dentry *root = debugfs_create_dir("memblock", NULL);
>  	if (!root)
> -		return -ENXIO;
> +		return -ENOMEM;
>  	debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
>  	debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);

Well, we don't know what we should return because
debugfs_create_file() is misdesigned - it should return an ERR_PTR.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mm/memblock.c: return -ENOMEM instead of -ENXIO on failure of debugfs_create_dir in memblock_init_debugfs
@ 2011-11-22 23:55   ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2011-11-22 23:55 UTC (permalink / raw)
  To: Wang Sheng-Hui; +Cc: yinghai, linux-mm, linux-kernel

On Wed, 09 Nov 2011 10:01:26 +0800
Wang Sheng-Hui <shhuiw@gmail.com> wrote:

> On the failure of debugfs_create_dir, we should return -ENOMEM
> instead of -ENXIO.
> 
> The patch is against 3.1.
> 
> 
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
>  mm/memblock.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index ccbf973..4d4d5ee 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -852,7 +852,7 @@ static int __init memblock_init_debugfs(void)
>  {
>  	struct dentry *root = debugfs_create_dir("memblock", NULL);
>  	if (!root)
> -		return -ENXIO;
> +		return -ENOMEM;
>  	debugfs_create_file("memory", S_IRUGO, root, &memblock.memory, &memblock_debug_fops);
>  	debugfs_create_file("reserved", S_IRUGO, root, &memblock.reserved, &memblock_debug_fops);

Well, we don't know what we should return because
debugfs_create_file() is misdesigned - it should return an ERR_PTR.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-22 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-09  2:01 [PATCH 1/2] mm/memblock.c: return -ENOMEM instead of -ENXIO on failure of debugfs_create_dir in memblock_init_debugfs Wang Sheng-Hui
2011-11-09  2:01 ` Wang Sheng-Hui
2011-11-22 23:55 ` Andrew Morton
2011-11-22 23:55   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.