All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: Remove never reached code
@ 2017-07-12  6:13 Nikolay Borisov
  2017-07-12 14:50 ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2017-07-12  6:13 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/relocation.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 65661d1aae4e..1a532bb72eab 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -1308,8 +1308,6 @@ static int __must_check __add_reloc_root(struct btrfs_root *root)
 		btrfs_panic(fs_info, -EEXIST,
 			    "Duplicate root found for start=%llu while inserting into relocation tree",
 			    node->bytenr);
-		kfree(node);
-		return -EEXIST;
 	}
 
 	list_add_tail(&root->root_list, &rc->reloc_roots);
-- 
2.7.4


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

* Re: [PATCH] btrfs: Remove never reached code
  2017-07-12  6:13 [PATCH] btrfs: Remove never reached code Nikolay Borisov
@ 2017-07-12 14:50 ` David Sterba
  2017-07-13 11:11   ` [PATCH v2] btrfs: Remove never reached error handling code in __add_reloc_root Nikolay Borisov
  0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2017-07-12 14:50 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-btrfs

The subject is too generic, and the changelog could say something about
the btrfs_panic semantics. Otherwise the change is ok, previously there
was just BUG_ON, then if -> btrfs_panic and after moving the kfree after
the print, the return has been added, but this is just redundant.

On Wed, Jul 12, 2017 at 09:13:58AM +0300, Nikolay Borisov wrote:
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  fs/btrfs/relocation.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> index 65661d1aae4e..1a532bb72eab 100644
> --- a/fs/btrfs/relocation.c
> +++ b/fs/btrfs/relocation.c
> @@ -1308,8 +1308,6 @@ static int __must_check __add_reloc_root(struct btrfs_root *root)
>  		btrfs_panic(fs_info, -EEXIST,
>  			    "Duplicate root found for start=%llu while inserting into relocation tree",
>  			    node->bytenr);
> -		kfree(node);
> -		return -EEXIST;
>  	}
>  
>  	list_add_tail(&root->root_list, &rc->reloc_roots);
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2] btrfs: Remove never reached error handling code in __add_reloc_root
  2017-07-12 14:50 ` David Sterba
@ 2017-07-13 11:11   ` Nikolay Borisov
  2017-07-21 16:02     ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2017-07-13 11:11 UTC (permalink / raw)
  To: dsterba; +Cc: linux-btrfs, Nikolay Borisov

One of the error handling paths in __add_reloc_root contains btrfs_panic()
followed by some other code. As the name implies what it does is print
some error message and call BUG, naturally what follow afterwards is not
invoked. So remove this extra code.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/relocation.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 65661d1aae4e..1a532bb72eab 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -1308,8 +1308,6 @@ static int __must_check __add_reloc_root(struct btrfs_root *root)
 		btrfs_panic(fs_info, -EEXIST,
 			    "Duplicate root found for start=%llu while inserting into relocation tree",
 			    node->bytenr);
-		kfree(node);
-		return -EEXIST;
 	}
 
 	list_add_tail(&root->root_list, &rc->reloc_roots);
-- 
2.7.4


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

* Re: [PATCH v2] btrfs: Remove never reached error handling code in __add_reloc_root
  2017-07-13 11:11   ` [PATCH v2] btrfs: Remove never reached error handling code in __add_reloc_root Nikolay Borisov
@ 2017-07-21 16:02     ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2017-07-21 16:02 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: dsterba, linux-btrfs

On Thu, Jul 13, 2017 at 02:11:07PM +0300, Nikolay Borisov wrote:
> One of the error handling paths in __add_reloc_root contains btrfs_panic()
> followed by some other code. As the name implies what it does is print
> some error message and call BUG, naturally what follow afterwards is not
> invoked. So remove this extra code.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>

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

end of thread, other threads:[~2017-07-21 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-12  6:13 [PATCH] btrfs: Remove never reached code Nikolay Borisov
2017-07-12 14:50 ` David Sterba
2017-07-13 11:11   ` [PATCH v2] btrfs: Remove never reached error handling code in __add_reloc_root Nikolay Borisov
2017-07-21 16:02     ` 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.