LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [dhowells-fs:netfs-folio-regions 14/28] fs/netfs/write_back.c:103:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2021-08-19 20:00 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-19 20:00 UTC (permalink / raw)
  To: David Howells; +Cc: clang-built-linux, kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2825 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio-regions
head:   215a4ee495a95cc73256ed76f91cb78bcabd6b8e
commit: 27ed0ce3a75fcb90e4c016da19682b7fb275ccaf [14/28] netfs: Initiate write request from a dirty region
config: hexagon-randconfig-r041-20210818 (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://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?id=27ed0ce3a75fcb90e4c016da19682b7fb275ccaf
        git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
        git fetch --no-tags dhowells-fs netfs-folio-regions
        git checkout 27ed0ce3a75fcb90e4c016da19682b7fb275ccaf
        # 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 <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> fs/netfs/write_back.c:103:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   if (!folio_trylock(folio))
                       ^~~~~~~~~~~~~~~~~~~~~
   fs/netfs/write_back.c:107:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   fs/netfs/write_back.c:103:3: note: remove the 'if' if its condition is always true
                   if (!folio_trylock(folio))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/write_back.c:90:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +103 fs/netfs/write_back.c

    84	
    85	static int netfs_lock_folios_iterator(struct xa_state *xas,
    86					      struct folio *folio,
    87					      struct netfs_write_request *wreq,
    88					      struct writeback_control *wbc)
    89	{
    90		int ret;
    91	
    92		/* At this point we hold neither the i_pages lock nor the
    93		 * folio lock: the folio may be truncated or invalidated
    94		 * (changing folio->mapping to NULL), or even swizzled
    95		 * back from swapper_space to tmpfs file mapping
    96		 */
    97		if (wbc->sync_mode != WB_SYNC_NONE) {
    98			xas_pause(xas);
    99			rcu_read_unlock();
   100			ret = folio_lock_killable(folio);
   101			rcu_read_lock();
   102		} else {
 > 103			if (!folio_trylock(folio))
   104				ret = -EBUSY;
   105		}
   106	
   107		return ret;
   108	}
   109	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26608 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-19 20:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 20:00 [dhowells-fs:netfs-folio-regions 14/28] fs/netfs/write_back.c:103:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).