public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: fs/xfs/xfs_exchmaps_item.c:57:5-24: WARNING: atomic_dec_and_test variation before object free at line 58.
Date: Thu, 26 Dec 2024 07:06:14 +0800	[thread overview]
Message-ID: <202412260634.uSDUNyYS-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-12-25 23:06 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=202412260634.uSDUNyYS-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox