block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.

From: kernel test robot
Date: Mon Nov 04 2024 - 17:52:56 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 557329bcecc2f55e134db8974953b32b69db9d15
commit: dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 block: Introduce zone write plugging
date: 7 months ago
config: alpha-randconfig-r064-20241105 (https://download.01.org/0day-ci/archive/20241105/202411050650.ilIZa8S7-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 13.3.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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411050650.ilIZa8S7-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.

vim +579 block/blk-zoned.c

576
577 static inline void disk_put_zone_wplug(struct blk_zone_wplug *zwplug)
578 {
> 579 if (atomic_dec_and_test(&zwplug->ref)) {
580 WARN_ON_ONCE(!bio_list_empty(&zwplug->bio_list));
581 WARN_ON_ONCE(!list_empty(&zwplug->link));
582
> 583 call_rcu(&zwplug->rcu_head, disk_free_zone_wplug_rcu);
584 }
585 }
586

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