Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535706

Re: [PATCH 1/1] btrfs: fix improper return value

From Omar Sandoval <osandov@osandov.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] btrfs: fix improper return value
Date 2016-12-04 21:00 +0100
Message-ID <sKL74-2Xh-23@gated-at.bofh.it> (permalink)
References <sKx46-2AG-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Dec 04, 2016 at 12:51:53PM +0800, Pan Bian wrote:
> In function btrfs_uuid_tree_iterate(), errno is assigned to variable ret
> on errors. However, it directly returns 0. It may be better to return
> ret. This patch also removes the warning, because the caller already
> prints a warning.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188731

Looks good.

Reviewed-by: Omar Sandoval <osandov@fb.com>

> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>  fs/btrfs/uuid-tree.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c
> index 7fc89e4..83bb2f2 100644
> --- a/fs/btrfs/uuid-tree.c
> +++ b/fs/btrfs/uuid-tree.c
> @@ -351,7 +351,5 @@ int btrfs_uuid_tree_iterate(struct btrfs_fs_info *fs_info,
>  
>  out:
>  	btrfs_free_path(path);
> -	if (ret)
> -		btrfs_warn(fs_info, "btrfs_uuid_tree_iterate failed %d", ret);
> -	return 0;
> +	return ret;
>  }
> -- 
> 1.9.1
> 
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] btrfs: fix improper return value Pan Bian <bianpan2016@163.com> - 2016-12-04 06:00 +0100
  Re: [PATCH 1/1] btrfs: fix improper return value Omar Sandoval <osandov@osandov.com> - 2016-12-04 21:00 +0100

csiph-web