Re: [PATCH 16/17] btrfs: zoned: finish fully written block group
From: Naohiro Aota <Naohiro.Aota@wdc.com>
Date: 2021-08-16 04:34:45
Also in:
oe-kbuild-all
On Thu, Aug 12, 2021 at 01:26:02AM +0800, kernel test robot wrote:
Hi Naohiro, I love your patch! Perhaps something to improve: [auto build test WARNING on kdave/for-next] [cannot apply to v5.14-rc5 next-20210811] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Naohiro-Aota/ZNS-Support-for-Btrfs/20210811-222302 base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next config: hexagon-randconfig-r041-20210810 (attached as .config) compiler: clang version 12.0.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/ccecd271dc2436fe587af8d2083c3c96ab86e309 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Naohiro-Aota/ZNS-Support-for-Btrfs/20210811-222302 git checkout ccecd271dc2436fe587af8d2083c3c96ab86e309 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=hexagon If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <redacted> All warnings (new ones prefixed by >>):quoted
quoted
fs/btrfs/zoned.c:1948:2: warning: variable 'ret' is used uninitialized whenever '?:' condition is true [-Wsometimes-uninitialized]ASSERT(!list_empty(&block_group->active_bg_list)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/btrfs/ctree.h:3458:3: note: expanded from macro 'ASSERT' (likely(expr) ? (void)0 : assertfail(#expr, __FILE__, __LINE__)) ^~~~~~~~~~~~ include/linux/compiler.h:77:20: note: expanded from macro 'likely' # define likely(x) __builtin_expect(!!(x), 1) ^~~~~~~~~~~~~~~~~~~~~~~~~~ fs/btrfs/zoned.c:1956:9: note: uninitialized use occurs here return ret; ^~~ fs/btrfs/zoned.c:1948:2: note: remove the '?:' if its condition is always false ASSERT(!list_empty(&block_group->active_bg_list)); ^ fs/btrfs/ctree.h:3458:3: note: expanded from macro 'ASSERT' (likely(expr) ? (void)0 : assertfail(#expr, __FILE__, __LINE__)) ^ include/linux/compiler.h:77:20: note: expanded from macro 'likely' # define likely(x) __builtin_expect(!!(x), 1) ^ fs/btrfs/zoned.c:1908:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 1 warning generated.
This looks false-positive for me but still I noticed this "ret" can never be non-zero in any path. So, I'll convert the function to "void" in the next version.