lkml.org 
[lkml]   [2019]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [f2fs-dev] [bug report] compiler warning: fs/f2fs/nod e.c: In function ‘ set nat cache dirty’: ‘head’ may be used uninitialized
From
Date
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
>

\
 
 \ /
  Last update: 2019-10-24 11:14    [W:1.697 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site