mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>,
	"linux-f2fs-devel@lists.sourceforge.net" 
	<linux-f2fs-devel@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "jaegeuk@kernel.org" <jaegeuk@kernel.org>
Subject: Re: [f2fs-dev] [bug report] compiler warning: fs/f2fs/node.c: In function ‘__set_nat_cache_dirty’: ‘head’ may be used uninitialized
Date: Thu, 24 Oct 2019 17:12:58 +0800	[thread overview]
Message-ID: <e815981a-50ef-0f49-cab6-e510ea44ddc0@huawei.com> (raw)
In-Reply-To: <fc71f3b73116115f78bcee2753e7bb3d5331731e.camel@analog.com>

On 2019/10/23 22:02, Ardelean, Alexandru wrote:
> Seems to have been introduced via:
> 
> ----------------------------------------------------------------
> 
> commit 780de47cf6cb5f524cd98ec8ffbffc3da5696e17
> Author: Chao Yu <yuchao0@huawei.com>
> Date:   Tue Mar 20 23:08:30 2018 +0800
> 
>     f2fs: don't track new nat entry in nat set
>     
>     Nat entry set is used only in checkpoint(), and during checkpoint() we
>     won't flush new nat entry with unallocated address, so we don't need to
>     add new nat entry into nat set, then nat_entry_set::entry_cnt can
>     indicate actual entry count we need to flush in checkpoint().
>     
>     Signed-off-by: Yunlei He <heyunlei@huawei.com>
>     Signed-off-by: Chao Yu <yuchao0@huawei.com>
>     Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ----------------------------------------------------------------
> 
> Compiler warning is:
> ----------------------------------------------------------------
> 
>   CC      fs/f2fs/node.o
> In file included from ./include/linux/wait.h:7:0,
>                  from ./include/linux/wait_bit.h:8,
>                  from ./include/linux/fs.h:6,
>                  from fs/f2fs/node.c:11:
> fs/f2fs/node.c: In function ‘__set_nat_cache_dirty’:
> ./include/linux/list.h:63:13: error: ‘head’ may be used uninitialized in
> this function [-Werror=maybe-uninitialized]
>   next->prev = new;
>              ^
> fs/f2fs/node.c:238:24: note: ‘head’ was declared here
>   struct nat_entry_set *head;

That's not correct, @head will only be assigned and used if new_ne equals NULL.

Thanks,

>                         ^
> cc1: all warnings being treated as errors
> ----------------------------------------------------------------
> 
> Thanks
> Alex
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> 

  reply	other threads:[~2019-10-24  9:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 14:02 Ardelean, Alexandru
2019-10-24  9:12 ` Chao Yu [this message]
2019-10-24  9:54   ` [f2fs-dev] " Ardelean, Alexandru
2019-10-25  8:04     ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e815981a-50ef-0f49-cab6-e510ea44ddc0@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=alexandru.Ardelean@analog.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®