All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [hch-xfs:xfs-zoned 89/98] fs/xfs/xfs_fsops.c:346 xfs_growfs_data() warn: inconsistent returns '&mp->m_growlock'.
Date: Sat, 23 Nov 2024 20:29:53 +0800	[thread overview]
Message-ID: <202411232011.Zes6bDSz-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Christoph Hellwig <hch@lst.de>

tree:   git://git.infradead.org/users/hch/xfs xfs-zoned
head:   1d218c27f2f5a8c87669b49292f1fd3432112426
commit: a37a349d7a21f1c61dc54c5771a81aee04a265cd [89/98] xfs: don't allow growfs of the data device with internal RT device
:::::: branch date: 27 hours ago
:::::: commit date: 27 hours ago
config: x86_64-randconfig-161-20241123 (https://download.01.org/0day-ci/archive/20241123/202411232011.Zes6bDSz-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202411232011.Zes6bDSz-lkp@intel.com/

smatch warnings:
fs/xfs/xfs_fsops.c:346 xfs_growfs_data() warn: inconsistent returns '&mp->m_growlock'.

vim +346 fs/xfs/xfs_fsops.c

83a7f86e39ff5d Dave Chinner        2018-05-13  292  
^1da177e4c3f41 Linus Torvalds      2005-04-16  293  /*
^1da177e4c3f41 Linus Torvalds      2005-04-16  294   * protected versions of growfs function acquire and release locks on the mount
^1da177e4c3f41 Linus Torvalds      2005-04-16  295   * point - exported through ioctls: XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG,
^1da177e4c3f41 Linus Torvalds      2005-04-16  296   * XFS_IOC_FSGROWFSRT
^1da177e4c3f41 Linus Torvalds      2005-04-16  297   */
^1da177e4c3f41 Linus Torvalds      2005-04-16  298  int
^1da177e4c3f41 Linus Torvalds      2005-04-16  299  xfs_growfs_data(
87444b8c267a5c Dave Chinner        2018-05-13  300  	struct xfs_mount	*mp,
87444b8c267a5c Dave Chinner        2018-05-13  301  	struct xfs_growfs_data	*in)
^1da177e4c3f41 Linus Torvalds      2005-04-16  302  {
87444b8c267a5c Dave Chinner        2018-05-13  303  	int			error = 0;
743bb4650da9e2 sandeen@sandeen.net 2008-11-25  304  
743bb4650da9e2 sandeen@sandeen.net 2008-11-25  305  	if (!capable(CAP_SYS_ADMIN))
2451337dd04390 Dave Chinner        2014-06-25  306  		return -EPERM;
cc92e7ac8d9641 Christoph Hellwig   2007-08-30  307  	if (!mutex_trylock(&mp->m_growlock))
2451337dd04390 Dave Chinner        2014-06-25  308  		return -EWOULDBLOCK;
87444b8c267a5c Dave Chinner        2018-05-13  309  
a37a349d7a21f1 Christoph Hellwig   2024-11-22  310  	/* we can't grow the data section when an internal RT section exists */
a37a349d7a21f1 Christoph Hellwig   2024-11-22  311  	if (in->newblocks != mp->m_sb.sb_dblocks && mp->m_sb.sb_rtstart)
a37a349d7a21f1 Christoph Hellwig   2024-11-22  312  		return -EINVAL;
a37a349d7a21f1 Christoph Hellwig   2024-11-22  313  
87444b8c267a5c Dave Chinner        2018-05-13  314  	/* update imaxpct separately to the physical grow of the filesystem */
87444b8c267a5c Dave Chinner        2018-05-13  315  	if (in->imaxpct != mp->m_sb.sb_imax_pct) {
87444b8c267a5c Dave Chinner        2018-05-13  316  		error = xfs_growfs_imaxpct(mp, in->imaxpct);
87444b8c267a5c Dave Chinner        2018-05-13  317  		if (error)
87444b8c267a5c Dave Chinner        2018-05-13  318  			goto out_error;
87444b8c267a5c Dave Chinner        2018-05-13  319  	}
87444b8c267a5c Dave Chinner        2018-05-13  320  
87444b8c267a5c Dave Chinner        2018-05-13  321  	if (in->newblocks != mp->m_sb.sb_dblocks) {
^1da177e4c3f41 Linus Torvalds      2005-04-16  322  		error = xfs_growfs_data_private(mp, in);
87444b8c267a5c Dave Chinner        2018-05-13  323  		if (error)
87444b8c267a5c Dave Chinner        2018-05-13  324  			goto out_error;
87444b8c267a5c Dave Chinner        2018-05-13  325  	}
87444b8c267a5c Dave Chinner        2018-05-13  326  
87444b8c267a5c Dave Chinner        2018-05-13  327  	/* Post growfs calculations needed to reflect new state in operations */
87444b8c267a5c Dave Chinner        2018-05-13  328  	if (mp->m_sb.sb_imax_pct) {
87444b8c267a5c Dave Chinner        2018-05-13  329  		uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct;
87444b8c267a5c Dave Chinner        2018-05-13  330  		do_div(icount, 100);
ef325959993edd Darrick J. Wong     2019-06-05  331  		M_IGEO(mp)->maxicount = XFS_FSB_TO_INO(mp, icount);
87444b8c267a5c Dave Chinner        2018-05-13  332  	} else
ef325959993edd Darrick J. Wong     2019-06-05  333  		M_IGEO(mp)->maxicount = 0;
87444b8c267a5c Dave Chinner        2018-05-13  334  
83a7f86e39ff5d Dave Chinner        2018-05-13  335  	/* Update secondary superblocks now the physical grow has completed */
b16817b66b6c97 Dave Chinner        2018-05-13  336  	error = xfs_update_secondary_sbs(mp);
83a7f86e39ff5d Dave Chinner        2018-05-13  337  
87444b8c267a5c Dave Chinner        2018-05-13  338  out_error:
527851124d10f9 Christoph Hellwig   2015-02-16  339  	/*
527851124d10f9 Christoph Hellwig   2015-02-16  340  	 * Increment the generation unconditionally, the error could be from
527851124d10f9 Christoph Hellwig   2015-02-16  341  	 * updating the secondary superblocks, in which case the new size
527851124d10f9 Christoph Hellwig   2015-02-16  342  	 * is live already.
527851124d10f9 Christoph Hellwig   2015-02-16  343  	 */
527851124d10f9 Christoph Hellwig   2015-02-16  344  	mp->m_generation++;
cc92e7ac8d9641 Christoph Hellwig   2007-08-30  345  	mutex_unlock(&mp->m_growlock);
^1da177e4c3f41 Linus Torvalds      2005-04-16 @346  	return error;
^1da177e4c3f41 Linus Torvalds      2005-04-16  347  }
^1da177e4c3f41 Linus Torvalds      2005-04-16  348  

:::::: The code at line 346 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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

             reply	other threads:[~2024-11-23 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-23 12:29 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-30  9:23 [hch-xfs:xfs-zoned 89/98] fs/xfs/xfs_fsops.c:346 xfs_growfs_data() warn: inconsistent returns '&mp->m_growlock' Dan Carpenter

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=202411232011.Zes6bDSz-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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.