Re: [PATCH 16/17] btrfs: zoned: finish fully written block group
From: kernel test robot <hidden>
Date: 2021-08-11 17:26:52
Also in:
oe-kbuild-all
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
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.
vim +1948 fs/btrfs/zoned.c
1900
1901 int btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical,
1902 u64 length)
1903 {
1904 struct btrfs_block_group *block_group;
1905 struct map_lookup *map;
1906 struct btrfs_device *device;
1907 u64 physical;
1908 int ret;
1909
1910 if (!btrfs_is_zoned(fs_info))
1911 return 0;
1912
1913 block_group = btrfs_lookup_block_group(fs_info, logical);
1914 ASSERT(block_group);
1915
1916 if (logical + length < block_group->start + block_group->zone_capacity) {
1917 ret = 0;
1918 goto out;
1919 }
1920
1921 spin_lock(&block_group->lock);
1922
1923 if (!block_group->zone_is_active) {
1924 spin_unlock(&block_group->lock);
1925 ret = 0;
1926 goto out;
1927 }
1928
1929 block_group->zone_is_active = 0;
1930 /* We should have consumed all the free space */
1931 ASSERT(block_group->alloc_offset == block_group->zone_capacity);
1932 ASSERT(block_group->free_space_ctl->free_space == 0);
1933 btrfs_clear_treelog_bg(block_group);
1934 spin_unlock(&block_group->lock);
1935
1936 map = block_group->physical_map;
1937 device = map->stripes[0].dev;
1938 physical = map->stripes[0].physical;
1939
1940 if (!device->zone_info->max_active_zones) {
1941 ret = 0;
1942 goto out;
1943 }
1944
1945 btrfs_dev_clear_active_zone(device, physical);
1946
1947 spin_lock(&fs_info->zone_active_bgs_lock);1948 ASSERT(!list_empty(&block_group->active_bg_list));
--- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Attachments
- .config.gz [application/gzip] 25180 bytes