All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [hch-xfs:xfs-trans-cleanups 5/8] fs/xfs/xfs_inode.c:2939:6: warning: variable 'error' is used uninitialized whenever 'if' condition is false
Date: Tue, 15 Jul 2025 23:41:19 +0800	[thread overview]
Message-ID: <202507152359.IWcfY6aZ-lkp@intel.com> (raw)

tree:   git://git.infradead.org/users/hch/xfs xfs-trans-cleanups
head:   eabea0b216f4782b4f15143d5b411b113026a69b
commit: 9823a1576f363cb62d4ad064359cb2c7b5d2c49a [5/8] xfs: return the allocated transaction from xfs_trans_alloc_empty
config: arm64-randconfig-004-20250715 (https://download.01.org/0day-ci/archive/20250715/202507152359.IWcfY6aZ-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 16534d19bf50bde879a83f0ae62875e2c5120e64)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250715/202507152359.IWcfY6aZ-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/202507152359.IWcfY6aZ-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/xfs/xfs_inode.c:2939:6: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    2939 |         if (xfs_inode_unlinked_incomplete(ip))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_inode.c:2944:9: note: uninitialized use occurs here
    2944 |         return error;
         |                ^~~~~
   fs/xfs/xfs_inode.c:2939:2: note: remove the 'if' if its condition is always true
    2939 |         if (xfs_inode_unlinked_incomplete(ip))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2940 |                 error = xfs_inode_reload_unlinked_bucket(tp, ip);
   fs/xfs/xfs_inode.c:2935:13: note: initialize the variable 'error' to silence this warning
    2935 |         int                     error;
         |                                      ^
         |                                       = 0
   1 warning generated.


vim +2939 fs/xfs/xfs_inode.c

83771c50e42b92 Darrick J. Wong   2023-09-11  2928  
83771c50e42b92 Darrick J. Wong   2023-09-11  2929  /* Decide if this inode is missing its unlinked list and reload it. */
83771c50e42b92 Darrick J. Wong   2023-09-11  2930  int
83771c50e42b92 Darrick J. Wong   2023-09-11  2931  xfs_inode_reload_unlinked(
83771c50e42b92 Darrick J. Wong   2023-09-11  2932  	struct xfs_inode	*ip)
83771c50e42b92 Darrick J. Wong   2023-09-11  2933  {
83771c50e42b92 Darrick J. Wong   2023-09-11  2934  	struct xfs_trans	*tp;
83771c50e42b92 Darrick J. Wong   2023-09-11  2935  	int			error;
83771c50e42b92 Darrick J. Wong   2023-09-11  2936  
9823a1576f363c Christoph Hellwig 2025-07-15  2937  	tp = xfs_trans_alloc_empty(ip->i_mount);
83771c50e42b92 Darrick J. Wong   2023-09-11  2938  	xfs_ilock(ip, XFS_ILOCK_SHARED);
83771c50e42b92 Darrick J. Wong   2023-09-11 @2939  	if (xfs_inode_unlinked_incomplete(ip))
83771c50e42b92 Darrick J. Wong   2023-09-11  2940  		error = xfs_inode_reload_unlinked_bucket(tp, ip);
83771c50e42b92 Darrick J. Wong   2023-09-11  2941  	xfs_iunlock(ip, XFS_ILOCK_SHARED);
83771c50e42b92 Darrick J. Wong   2023-09-11  2942  	xfs_trans_cancel(tp);
83771c50e42b92 Darrick J. Wong   2023-09-11  2943  
83771c50e42b92 Darrick J. Wong   2023-09-11  2944  	return error;
83771c50e42b92 Darrick J. Wong   2023-09-11  2945  }
d9041681dd2f53 Darrick J. Wong   2023-12-15  2946  

:::::: The code at line 2939 was first introduced by commit
:::::: 83771c50e42b92de6740a63e152c96c052d37736 xfs: reload entire unlinked bucket lists

:::::: TO: Darrick J. Wong <djwong@kernel.org>
:::::: CC: Darrick J. Wong <djwong@kernel.org>

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

                 reply	other threads:[~2025-07-15 15:42 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=202507152359.IWcfY6aZ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hch@lst.de \
    --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.