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-Btr...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: x86_64-randconfig-a012-20210810 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
d39ebdae674c8efc84ebe8dc32716ec353220530)
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/ccecd271dc2436fe587af8d2083c3c96a...
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=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> fs/btrfs/zoned.c:1940:6: warning: variable 'ret' is used
uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!device->zone_info->max_active_zones) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/zoned.c:1956:9: note: uninitialized use occurs here
return ret;
^~~
fs/btrfs/zoned.c:1940:2: note: remove the 'if' if its condition is always true
if (!device->zone_info->max_active_zones) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/zoned.c:1908:9: note: initialize the variable 'ret' to silence this
warning
int ret;
^
= 0
1 warning generated.
vim +1940 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) {
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org