[chao:feature/cache 2/13] fs/f2fs/cache.c:167:5-24: WARNING: atomic_dec_and_test variation before object free at line 168.

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git feature/cache
head:   f5af6f6f61922c3233196de6f4ff119760b86258
commit: b803186a2293df7ecc9c0e16e51dc01c2c4f8730 [2/13] f2fs: cache: implement metadata cache
config: csky-randconfig-r064-20260821 (https://download.01.org/0day-ci/archive/20260821/[email protected]/config)
compiler: csky-linux-gcc (GCC) 14.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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

cocci warnings: (new ones prefixed by >>)
>> fs/f2fs/cache.c:167:5-24: WARNING: atomic_dec_and_test variation before object free at line 168.

vim +167 fs/f2fs/cache.c

   163	
   164	static bool f2fs_cache_put(struct f2fs_cached_block *entry)
   165	{
   166		WARN_ON_ONCE(!f2fs_cache_refcount(entry));
 > 167		if (atomic_dec_and_test(&entry->refcount)) {
 > 168			f2fs_free_cache(entry);
   169			return true;
   170		}
   171		return false;
   172	}
   173	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.