Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [dhowells-fs:netfs-next 46/50] fs/9p/vfs_addr.c:79:6: warning: variable 'len' is used uninitialized whenever 'if' condition is true
@ 2026-05-02 16:43 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-02 16:43 UTC (permalink / raw)
  To: David Howells; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-next
head:   2c55c7cf98847d593219ef29d3fedfd551d6f55f
commit: e192187e9d3cdb786b7b6aeb6fc6d4048a806004 [46/50] netfs: Combine prepare and issue ops and grab the buffers on request
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260502/202605021801.7vqkz933-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/20260502/202605021801.7vqkz933-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/202605021801.7vqkz933-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/9p/vfs_addr.c:79:6: warning: variable 'len' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      79 |         if (err < 0)
         |             ^~~~~~~
   fs/9p/vfs_addr.c:90:51: note: uninitialized use occurs here
      90 |         return netfs_write_subrequest_terminated(subreq, len ?: err);
         |                                                          ^~~
   fs/9p/vfs_addr.c:79:2: note: remove the 'if' if its condition is always false
      79 |         if (err < 0)
         |         ^~~~~~~~~~~~
      80 |                 goto term;
         |                 ~~~~~~~~~
   fs/9p/vfs_addr.c:74:14: note: initialize the variable 'len' to silence this warning
      74 |         int err, len;
         |                     ^
         |                      = 0
   1 warning generated.
--
>> fs/netfs/write_collect.c:155:7: warning: variable 'fpos' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     155 |                 if (!bvecq->bv[slot].bv_page) {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/write_collect.c:187:7: note: uninitialized use occurs here
     187 |                 if (fpos + fsize >= collected_to)
         |                     ^~~~
   fs/netfs/write_collect.c:155:3: note: remove the 'if' if its condition is always false
     155 |                 if (!bvecq->bv[slot].bv_page) {
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     156 |                         WARN_ONCE(1, "R=%08x slot already cleared?\n", wreq->debug_id);
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     157 |                         fsize = bvecq->bv[slot].bv_len;
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     158 |                         goto skip;
         |                         ~~~~~~~~~~
     159 |                 }
         |                 ~
   fs/netfs/write_collect.c:137:26: note: initialize the variable 'fpos' to silence this warning
     137 |                 unsigned long long fpos, fend;
         |                                        ^
         |                                         = 0
   1 warning generated.


vim +79 fs/9p/vfs_addr.c

    66	
    67	/*
    68	 * Issue a subrequest to write to the server.
    69	 */
    70	static void v9fs_issue_write(struct netfs_io_subrequest *subreq)
    71	{
    72		struct iov_iter iter;
    73		struct p9_fid *fid = subreq->rreq->netfs_priv;
    74		int err, len;
    75	
    76		subreq->len = umin(subreq->len, fid->clnt->msize - P9_IOHDRSZ);
    77	
    78		err = netfs_prepare_write_buffer(subreq, INT_MAX);
  > 79		if (err < 0)
    80			goto term;
    81	
    82		iov_iter_bvec_queue(&iter, ITER_SOURCE, subreq->content.bvecq,
    83				    subreq->content.slot, subreq->content.offset, subreq->len);
    84	
    85		len = p9_client_write(fid, subreq->start, &iter, &err);
    86		if (len > 0)
    87			__set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);
    88	
    89	term:
    90		return netfs_write_subrequest_terminated(subreq, len ?: err);
    91	}
    92	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dhowells-fs:netfs-next 46/50] fs/9p/vfs_addr.c:79:6: warning: variable 'len' is used uninitialized whenever 'if' condition is true
@ 2026-05-03 13:36 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-03 13:36 UTC (permalink / raw)
  To: David Howells; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-next
head:   2c55c7cf98847d593219ef29d3fedfd551d6f55f
commit: e192187e9d3cdb786b7b6aeb6fc6d4048a806004 [46/50] netfs: Combine prepare and issue ops and grab the buffers on request
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260503/202605032150.Zu7t6u9z-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260503/202605032150.Zu7t6u9z-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/202605032150.Zu7t6u9z-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/9p/vfs_addr.c:79:6: warning: variable 'len' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      79 |         if (err < 0)
         |             ^~~~~~~
   fs/9p/vfs_addr.c:90:51: note: uninitialized use occurs here
      90 |         return netfs_write_subrequest_terminated(subreq, len ?: err);
         |                                                          ^~~
   fs/9p/vfs_addr.c:79:2: note: remove the 'if' if its condition is always false
      79 |         if (err < 0)
         |         ^~~~~~~~~~~~
      80 |                 goto term;
         |                 ~~~~~~~~~
   fs/9p/vfs_addr.c:74:14: note: initialize the variable 'len' to silence this warning
      74 |         int err, len;
         |                     ^
         |                      = 0
   1 warning generated.
--
>> fs/netfs/write_collect.c:155:7: warning: variable 'fpos' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     155 |                 if (!bvecq->bv[slot].bv_page) {
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/write_collect.c:187:7: note: uninitialized use occurs here
     187 |                 if (fpos + fsize >= collected_to)
         |                     ^~~~
   fs/netfs/write_collect.c:155:3: note: remove the 'if' if its condition is always false
     155 |                 if (!bvecq->bv[slot].bv_page) {
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     156 |                         WARN_ONCE(1, "R=%08x slot already cleared?\n", wreq->debug_id);
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     157 |                         fsize = bvecq->bv[slot].bv_len;
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     158 |                         goto skip;
         |                         ~~~~~~~~~~
     159 |                 }
         |                 ~
   fs/netfs/write_collect.c:137:26: note: initialize the variable 'fpos' to silence this warning
     137 |                 unsigned long long fpos, fend;
         |                                        ^
         |                                         = 0
   1 warning generated.
--
>> fs/netfs/read_pgpriv2.c:204:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
     204 |         return ret;
         |                ^~~
   fs/netfs/read_pgpriv2.c:187:9: note: initialize the variable 'ret' to silence this warning
     187 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +79 fs/9p/vfs_addr.c

    66	
    67	/*
    68	 * Issue a subrequest to write to the server.
    69	 */
    70	static void v9fs_issue_write(struct netfs_io_subrequest *subreq)
    71	{
    72		struct iov_iter iter;
    73		struct p9_fid *fid = subreq->rreq->netfs_priv;
    74		int err, len;
    75	
    76		subreq->len = umin(subreq->len, fid->clnt->msize - P9_IOHDRSZ);
    77	
    78		err = netfs_prepare_write_buffer(subreq, INT_MAX);
  > 79		if (err < 0)
    80			goto term;
    81	
    82		iov_iter_bvec_queue(&iter, ITER_SOURCE, subreq->content.bvecq,
    83				    subreq->content.slot, subreq->content.offset, subreq->len);
    84	
    85		len = p9_client_write(fid, subreq->start, &iter, &err);
    86		if (len > 0)
    87			__set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);
    88	
    89	term:
    90		return netfs_write_subrequest_terminated(subreq, len ?: err);
    91	}
    92	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-03 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-02 16:43 [dhowells-fs:netfs-next 46/50] fs/9p/vfs_addr.c:79:6: warning: variable 'len' is used uninitialized whenever 'if' condition is true kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-03 13:36 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