mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: fs/afs/server.c:375:5-24: WARNING: atomic_dec_and_test variation before object free at line 383.
Date: Tue, 02 Jun 2026 10:09:06 +0800	[thread overview]
Message-ID: <202606021010.6QMyYfim-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e43ffb69e0438cddd72aaa30898b4dc446f664f8
commit: 4882ba78574e2d8c579658f65f6784b0d139d173 afs: Fix afs_server ref accounting
date:   1 year, 3 months ago
config: hexagon-randconfig-r064-20260601 (https://download.01.org/0day-ci/archive/20260602/202606021010.6QMyYfim-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 9409c07de6378507397ecdb6f05f628f58110112)

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
| Fixes: 4882ba78574e ("afs: Fix afs_server ref accounting")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606021010.6QMyYfim-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/afs/server.c:375:5-24: WARNING: atomic_dec_and_test variation before object free at line 383.
   fs/afs/server.c:357:5-24: WARNING: atomic_dec_and_test variation before object free at line 360.

vim +375 fs/afs/server.c

   365	
   366	/*
   367	 * Drop an active count on a server object.
   368	 */
   369	void afs_unuse_server(struct afs_net *net, struct afs_server *server,
   370			      enum afs_server_trace reason)
   371	{
   372		if (!server)
   373			return;
   374	
 > 375		if (atomic_dec_and_test(&server->active)) {
   376			if (!test_bit(AFS_SERVER_FL_EXPIRED, &server->flags) &&
   377			    READ_ONCE(server->cell->state) < AFS_CELL_FAILED) {
   378				time64_t unuse_time = ktime_get_real_seconds();
   379	
   380				server->unuse_time = unuse_time;
   381				afs_set_server_timer(server, afs_server_gc_delay);
   382			} else {
 > 383				schedule_work(&server->destroyer);
   384			}
   385		}
   386	
   387		afs_put_server(net, server, reason);
   388	}
   389	

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

             reply	other threads:[~2026-06-02  2:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02  2:09 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-20 16:52 kernel test robot

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=202606021010.6QMyYfim-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dhowells@redhat.com \
    --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

all inboxes | Powered by JetHome®