All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [dhowells-fs:netfs-lib 25/34] fs/netfs/io.c:871:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true
Date: Mon, 2 Oct 2023 23:19:06 +0800	[thread overview]
Message-ID: <202310022348.lsNkvm7R-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-lib
head:   8b08a7e2d3217f7054808246fc559c867f54a524
commit: 051a41b875d04f931d3416d7b15e4cd3f6ba4edb [25/34] netfs: Implement DIO write support
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231002/202310022348.lsNkvm7R-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231002/202310022348.lsNkvm7R-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/202310022348.lsNkvm7R-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/netfs/io.c:871:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (len2 && !netfs_rmw_read_one(rreq, start2, len2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/io.c:898:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   fs/netfs/io.c:871:2: note: remove the 'if' if its condition is always false
           if (len2 && !netfs_rmw_read_one(rreq, start2, len2))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/io.c:869:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (len1 && !netfs_rmw_read_one(rreq, start1, len1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/io.c:898:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   fs/netfs/io.c:869:2: note: remove the 'if' if its condition is always false
           if (len1 && !netfs_rmw_read_one(rreq, start1, len1))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/netfs/io.c:849:13: note: initialize the variable 'ret' to silence this warning
           ssize_t ret;
                      ^
                       = 0
   2 warnings generated.


vim +871 fs/netfs/io.c

   837	
   838	/*
   839	 * Begin the process of reading in one or two chunks of data for use by
   840	 * unbuffered write to perform an RMW cycle.  We don't read directly into the
   841	 * write buffer as this may get called to redo the read in the case that a
   842	 * conditional write fails due to conflicting 3rd-party modifications.
   843	 */
   844	ssize_t netfs_rmw_read(struct netfs_io_request *wreq, struct file *file,
   845			       unsigned long long start1, size_t len1,
   846			       unsigned long long start2, size_t len2)
   847	{
   848		struct netfs_io_request *rreq;
   849		ssize_t ret;
   850	
   851		_enter("RMW:R=%x %llx-%llx %llx-%llx",
   852		       rreq->debug_id, start1, start1 + len1 - 1, start2, start2 + len2 - 1);
   853	
   854		rreq = netfs_alloc_request(wreq->mapping, file,
   855					   start1, start2 - start1 + len2, NETFS_RMW_READ);
   856		if (IS_ERR(rreq))
   857			return PTR_ERR(rreq);
   858	
   859		INIT_WORK(&rreq->work, netfs_rreq_work);
   860	
   861		rreq->iter = wreq->io_iter;
   862		__set_bit(NETFS_RREQ_CRYPT_IN_PLACE, &rreq->flags);
   863		__set_bit(NETFS_RREQ_USE_BOUNCE_BUFFER, &rreq->flags);
   864	
   865		/* Chop the reads into slices according to what the netfs wants and
   866		 * submit each one.
   867		 */
   868		atomic_set(&rreq->nr_outstanding, 1);
   869		if (len1 && !netfs_rmw_read_one(rreq, start1, len1))
   870			goto out;
 > 871		if (len2 && !netfs_rmw_read_one(rreq, start2, len2))

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

                 reply	other threads:[~2023-10-02 15:20 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=202310022348.lsNkvm7R-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dhowells@redhat.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.