public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [trondmy-nfs-2.6:testing 26/35] fs/nfs/write.c:2049:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2026-01-04  5:56 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-01-04  5:56 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: llvm, oe-kbuild-all

tree:   git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git testing
head:   bf5a9581839ebeebbd3bd004a174fea9afa19dcb
commit: 3533434037066b610d50e7bd36f3525ace296928 [26/35] NFS: Fix a deadlock involving nfs_release_folio()
config: i386-defconfig (https://download.01.org/0day-ci/archive/20260104/202601041331.pbHo7TSH-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260104/202601041331.pbHo7TSH-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601041331.pbHo7TSH-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/nfs/write.c:2049:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    2049 |         if (folio_clear_dirty_for_io(folio)) {
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/write.c:2056:9: note: uninitialized use occurs here
    2056 |         return ret;
         |                ^~~
   fs/nfs/write.c:2049:2: note: remove the 'if' if its condition is always true
    2049 |         if (folio_clear_dirty_for_io(folio)) {
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2050 |                 trace_nfs_writeback_folio_reclaim(inode, range_start, len);
    2051 |                 ret = nfs_writepage_locked(folio, &wbc);
    2052 |                 trace_nfs_writeback_folio_reclaim_done(inode, range_start, len,
    2053 |                                                        ret);
    2054 |         } else
         |           ~~~~
    2055 |                 nfs_commit_inode(inode, 0);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/write.c:2045:9: note: initialize the variable 'ret' to silence this warning
    2045 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +2049 fs/nfs/write.c

  2026	
  2027	/**
  2028	 * nfs_wb_folio_reclaim - Write back all requests on one page
  2029	 * @inode: pointer to page
  2030	 * @folio: pointer to folio
  2031	 *
  2032	 * Assumes that the folio has been locked by the caller
  2033	 */
  2034	int nfs_wb_folio_reclaim(struct inode *inode, struct folio *folio)
  2035	{
  2036		loff_t range_start = folio_pos(folio);
  2037		size_t len = folio_size(folio);
  2038		struct writeback_control wbc = {
  2039			.sync_mode = WB_SYNC_ALL,
  2040			.nr_to_write = 0,
  2041			.range_start = range_start,
  2042			.range_end = range_start + len - 1,
  2043			.for_sync = 1,
  2044		};
  2045		int ret;
  2046	
  2047		if (folio_test_writeback(folio))
  2048			return -EBUSY;
> 2049		if (folio_clear_dirty_for_io(folio)) {
  2050			trace_nfs_writeback_folio_reclaim(inode, range_start, len);
  2051			ret = nfs_writepage_locked(folio, &wbc);
  2052			trace_nfs_writeback_folio_reclaim_done(inode, range_start, len,
  2053							       ret);
  2054		} else
  2055			nfs_commit_inode(inode, 0);
  2056		return ret;
  2057	}
  2058	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2026-01-04  5:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-04  5:56 [trondmy-nfs-2.6:testing 26/35] fs/nfs/write.c:2049:6: 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