Re: [PATCH 3/6] Btrfs: refactor btrfs_file_write_iter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Liu,

[auto build test WARNING on tip/perf/core]
[also build test WARNING on v4.9-rc8 next-20161207]
[cannot apply to btrfs/next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Liu-Bo/btrfs-dax-IO/20161208-082651
config: x86_64-randconfig-x001-201649 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   fs/btrfs/file.c: In function 'btrfs_file_write_iter':
>> fs/btrfs/file.c:1823:5: warning: 'oldsize' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (oldsize < pos)
        ^
   fs/btrfs/file.c:1809:9: note: 'oldsize' was declared here
     loff_t oldsize;
            ^~~~~~~

vim +/oldsize +1823 fs/btrfs/file.c

  1807		struct inode *inode = file_inode(file);
  1808		loff_t pos;
  1809		loff_t oldsize;
  1810		ssize_t ret;
  1811	
  1812		inode_lock(inode);
  1813		ret = btrfs_file_write_check(iocb, from);
  1814		if (ret)
  1815			goto out;
  1816	
  1817		current->backing_dev_info = inode_to_bdi(inode);
  1818	
  1819		pos = iocb->ki_pos;
  1820		ret = __btrfs_buffered_write(file, from, pos);
  1821		if (ret > 0)
  1822			iocb->ki_pos = pos + ret;
> 1823		if (oldsize < pos)
  1824			pagecache_isize_extended(inode, oldsize,
  1825						i_size_read(inode));
  1826	
  1827		current->backing_dev_info = NULL;
  1828	out:
  1829		inode_unlock(inode);
  1830		return ret;
  1831	}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux