All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [trondmy-nfs-2.6:testing 26/35] fs/nfs/write.c:2049:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Sun, 04 Jan 2026 13:56:50 +0800	[thread overview]
Message-ID: <202601041331.pbHo7TSH-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-01-04  5:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202601041331.pbHo7TSH-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.