public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* fs/xfs/xfs_exchmaps_item.c:57:5-24: WARNING: atomic_dec_and_test variation before object free at line 58.
@ 2024-12-25 23:06 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-12-25 23:06 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: oe-kbuild-all, linux-kernel, Christoph Hellwig

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9b2ffa6148b1e4468d08f7e0e7e371c43cac9ffe
commit: 6c08f434bd33f88cf169e9e43c7a5e42fb3f2118 xfs: introduce a file mapping exchange log intent item
date:   8 months ago
config: hexagon-randconfig-r064-20241225 (https://download.01.org/0day-ci/archive/20241226/202412260634.uSDUNyYS-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 9daf10ff8f29ba3a88a105aaa9d2379c21b77d35)

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/202412260634.uSDUNyYS-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_exchmaps_item.c:57:5-24: WARNING: atomic_dec_and_test variation before object free at line 58.

vim +57 fs/xfs/xfs_exchmaps_item.c

    44	
    45	/*
    46	 * Freeing the XMI requires that we remove it from the AIL if it has already
    47	 * been placed there. However, the XMI may not yet have been placed in the AIL
    48	 * when called by xfs_xmi_release() from XMD processing due to the ordering of
    49	 * committed vs unpin operations in bulk insert operations. Hence the reference
    50	 * count to ensure only the last caller frees the XMI.
    51	 */
    52	STATIC void
    53	xfs_xmi_release(
    54		struct xfs_xmi_log_item	*xmi_lip)
    55	{
    56		ASSERT(atomic_read(&xmi_lip->xmi_refcount) > 0);
  > 57		if (atomic_dec_and_test(&xmi_lip->xmi_refcount)) {
  > 58			xfs_trans_ail_delete(&xmi_lip->xmi_item, 0);
    59			xfs_xmi_item_free(xmi_lip);
    60		}
    61	}
    62	

-- 
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:[~2024-12-25 23:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-25 23:06 fs/xfs/xfs_exchmaps_item.c:57:5-24: WARNING: atomic_dec_and_test variation before object free at line 58 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