All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>, kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [axboe-block:for-6.15/block 75/76] drivers/block/loop.c:388:6-25: WARNING: atomic_dec_and_test variation before object free at line 395.
Date: Mon, 24 Mar 2025 05:46:39 -0600	[thread overview]
Message-ID: <e27c19fe-6d42-4875-b918-8cacbe8daa6d@kernel.dk> (raw)
In-Reply-To: <Z-CpA6YVKLc2zxfb@fedora>

On 3/23/25 6:36 PM, Ming Lei wrote:
> On Mon, Mar 24, 2025 at 06:52:22AM +0800, kernel test robot wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-6.15/block
>> head:   4c3f4bad7a6e9022489a9f8392f7147ed3ce74b1
>> commit: dfc77a934a3acdb13dadf237b7417c6a31b19da8 [75/76] loop: try to handle loop aio command via NOWAIT IO first
>> config: i386-randconfig-052-20250323 (https://download.01.org/0day-ci/archive/20250324/202503240625.LfSMQqA2-lkp@intel.com/config)
>> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
>>
>> 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/202503240625.LfSMQqA2-lkp@intel.com/
>>
>> cocci warnings: (new ones prefixed by >>)
>>>> drivers/block/loop.c:388:6-25: WARNING: atomic_dec_and_test variation before object free at line 395.
> 
> The code itself is safe. Event through the atomic counter drops to zero,
> the object isn't freed, and the counter can be re-initialized & requeued
> internally.
> 
> This cocci rule should be 'wrong', or anyone can explain the exact risk
> here?

It's just a generic thing that it always reports, in case atomic_t is
used where a refcount_t would be "safer". You can just ignore it.

-- 
Jens Axboe

      reply	other threads:[~2025-03-24 11:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-23 22:52 [axboe-block:for-6.15/block 75/76] drivers/block/loop.c:388:6-25: WARNING: atomic_dec_and_test variation before object free at line 395 kernel test robot
2025-03-24  0:36 ` Ming Lei
2025-03-24 11:46   ` Jens Axboe [this message]

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=e27c19fe-6d42-4875-b918-8cacbe8daa6d@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=lkp@intel.com \
    --cc=ming.lei@redhat.com \
    --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.