All of lore.kernel.org
 help / color / mirror / Atom feed
* [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
@ 2025-07-15 15:41 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-07-15 15:41 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: oe-kbuild-all

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

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

only message in thread, other threads:[~2025-07-15 15:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 15:41 [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 kernel test robot

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.