All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted()
@ 2020-01-10  5:51 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-01-10  5:51 UTC (permalink / raw)
  To: Chris Mason, Dennis Zhou
  Cc: Josef Bacik, David Sterba, Anand Jain, linux-btrfs, kernel-janitors

The error code wasn't set on this error path.

Fixes: e12ebce8a4a8 ("btrfs: sysfs: make UUID/debug have its own kobject")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/btrfs/sysfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 58486229be95..55e4ed1af29c 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -1288,8 +1288,10 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)
 
 #ifdef CONFIG_BTRFS_DEBUG
 	fs_info->debug_kobj = kobject_create_and_add("debug", fsid_kobj);
-	if (!fs_info->debug_kobj)
+	if (!fs_info->debug_kobj) {
+		error = -ENOMEM;
 		goto failure;
+	}
 
 	error = sysfs_create_files(fs_info->debug_kobj, btrfs_debug_mount_attrs);
 	if (error)
-- 
2.11.0


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

* [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted()
@ 2020-01-10  5:51 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-01-10  5:51 UTC (permalink / raw)
  To: Chris Mason, Dennis Zhou
  Cc: Josef Bacik, David Sterba, Anand Jain, linux-btrfs, kernel-janitors

The error code wasn't set on this error path.

Fixes: e12ebce8a4a8 ("btrfs: sysfs: make UUID/debug have its own kobject")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/btrfs/sysfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 58486229be95..55e4ed1af29c 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -1288,8 +1288,10 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)
 
 #ifdef CONFIG_BTRFS_DEBUG
 	fs_info->debug_kobj = kobject_create_and_add("debug", fsid_kobj);
-	if (!fs_info->debug_kobj)
+	if (!fs_info->debug_kobj) {
+		error = -ENOMEM;
 		goto failure;
+	}
 
 	error = sysfs_create_files(fs_info->debug_kobj, btrfs_debug_mount_attrs);
 	if (error)
-- 
2.11.0

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

* Re: [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted()
  2020-01-10  5:51 ` Dan Carpenter
@ 2020-01-10  9:13   ` Anand Jain
  -1 siblings, 0 replies; 6+ messages in thread
From: Anand Jain @ 2020-01-10  9:13 UTC (permalink / raw)
  To: Dan Carpenter, Chris Mason, Dennis Zhou
  Cc: Josef Bacik, David Sterba, linux-btrfs, kernel-janitors



On 10/1/20 1:51 PM, Dan Carpenter wrote:
> The error code wasn't set on this error path.
 >
> Fixes: e12ebce8a4a8 ("btrfs: sysfs: make UUID/debug have its own kobject")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   fs/btrfs/sysfs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index 58486229be95..55e4ed1af29c 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -1288,8 +1288,10 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)
>   
>   #ifdef CONFIG_BTRFS_DEBUG
>   	fs_info->debug_kobj = kobject_create_and_add("debug", fsid_kobj);
> -	if (!fs_info->debug_kobj)
> +	if (!fs_info->debug_kobj) {
> +		error = -ENOMEM;


  uh-oh right.

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

>   		goto failure;
> +	}
>   
>   	error = sysfs_create_files(fs_info->debug_kobj, btrfs_debug_mount_attrs);
>   	if (error)
> 

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

* Re: [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted()
@ 2020-01-10  9:13   ` Anand Jain
  0 siblings, 0 replies; 6+ messages in thread
From: Anand Jain @ 2020-01-10  9:13 UTC (permalink / raw)
  To: Dan Carpenter, Chris Mason, Dennis Zhou
  Cc: Josef Bacik, David Sterba, linux-btrfs, kernel-janitors



On 10/1/20 1:51 PM, Dan Carpenter wrote:
> The error code wasn't set on this error path.
 >
> Fixes: e12ebce8a4a8 ("btrfs: sysfs: make UUID/debug have its own kobject")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   fs/btrfs/sysfs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index 58486229be95..55e4ed1af29c 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -1288,8 +1288,10 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)
>   
>   #ifdef CONFIG_BTRFS_DEBUG
>   	fs_info->debug_kobj = kobject_create_and_add("debug", fsid_kobj);
> -	if (!fs_info->debug_kobj)
> +	if (!fs_info->debug_kobj) {
> +		error = -ENOMEM;


  uh-oh right.

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

>   		goto failure;
> +	}
>   
>   	error = sysfs_create_files(fs_info->debug_kobj, btrfs_debug_mount_attrs);
>   	if (error)
> 

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

* Re: [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted()
  2020-01-10  5:51 ` Dan Carpenter
@ 2020-01-10 17:06   ` David Sterba
  -1 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2020-01-10 17:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Mason, Dennis Zhou, Josef Bacik, David Sterba, Anand Jain,
	linux-btrfs, kernel-janitors

On Fri, Jan 10, 2020 at 08:51:27AM +0300, Dan Carpenter wrote:
> The error code wasn't set on this error path.
> 
> Fixes: e12ebce8a4a8 ("btrfs: sysfs: make UUID/debug have its own kobject")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, folded to the original patch.

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

* Re: [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted()
@ 2020-01-10 17:06   ` David Sterba
  0 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2020-01-10 17:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Mason, Dennis Zhou, Josef Bacik, David Sterba, Anand Jain,
	linux-btrfs, kernel-janitors

On Fri, Jan 10, 2020 at 08:51:27AM +0300, Dan Carpenter wrote:
> The error code wasn't set on this error path.
> 
> Fixes: e12ebce8a4a8 ("btrfs: sysfs: make UUID/debug have its own kobject")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, folded to the original patch.

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

end of thread, other threads:[~2020-01-10 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10  5:51 [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted() Dan Carpenter
2020-01-10  5:51 ` Dan Carpenter
2020-01-10  9:13 ` Anand Jain
2020-01-10  9:13   ` Anand Jain
2020-01-10 17:06 ` David Sterba
2020-01-10 17:06   ` David Sterba

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.