lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 12 Apr 2020 08:52:08 +0800
From:   Qu Wenruo <quwenruo.btrfs@....com>
To:     Tang Bin <tangbin@...s.chinamobile.com>, clm@...com,
        josef@...icpanda.com, dsterba@...e.com
Cc:     linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        Shengju Zhang <zhangshengju@...s.chinamobile.com>
Subject: Re: [PATCH] btrfs: Fix backref.c selftest compilation warning



On 2020/4/11 下午11:49, Tang Bin wrote:
> Fix missing braces compilation warning in the ARM
> compiler environment:
>     fs/btrfs/backref.c: In function ‘is_shared_data_backref’:
>     fs/btrfs/backref.c:394:9: warning: missing braces around initializer [-Wmissing-braces]
>       struct prelim_ref target = {0};
>     fs/btrfs/backref.c:394:9: warning: (near initialization for ‘target.rbnode’) [-Wmissing-braces]

GCC version please.

It looks like you're using an older GCC, as it's pretty common certain
prebuild tool chain is still using outdated GCC.

In my environment with GCC 9.2.0 natively (on aarch64) it's completely fine.
Thus personally I recommend to build your own tool chain using
buildroot, or run it natively, other than rely on prebuilt one.

> 
> Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
> Signed-off-by: Shengju Zhang <zhangshengju@...s.chinamobile.com>
> ---
>  fs/btrfs/backref.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
> index 9c380e7..0cc0257 100644
> --- a/fs/btrfs/backref.c
> +++ b/fs/btrfs/backref.c
> @@ -391,7 +391,7 @@ static int is_shared_data_backref(struct preftrees *preftrees, u64 bytenr)
>  	struct rb_node **p = &preftrees->direct.root.rb_root.rb_node;
>  	struct rb_node *parent = NULL;
>  	struct prelim_ref *ref = NULL;
> -	struct prelim_ref target = {0};
> +	struct prelim_ref target = {};

In fact your fix could cause problem, as the original code is
initializing all members to 0, but now it's uninitialized.

You need to locate the root cause other than blindly follow the warning.

Thanks,
Qu

>  	int result;
>  
>  	target.parent = bytenr;
> 



Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists