oe-kbuild.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* fs/afs/file.c:420:48-49: WARNING: atomic_add_unless
@ 2024-04-05  8:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-05  8:25 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall, Elena Reshetova

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Al Viro <viro@zeniv.linux.org.uk>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8cb4a9a82b21623dbb4b3051dd30d98356cf95bc
commit: 275655d3207b9e65d1561bf21c06a622d9ec1d43 afs: fix __afs_break_callback() / afs_drop_open_mmap() race
date:   6 weeks ago
:::::: branch date: 8 hours ago
:::::: commit date: 6 weeks ago
config: parisc-randconfig-r063-20240405 (https://download.01.org/0day-ci/archive/20240405/202404051635.si5VKXoE-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202404051635.si5VKXoE-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
   fs/afs/file.c:428:5-24: WARNING: atomic_dec_and_test variation before object free at line 429.
>> fs/afs/file.c:420:48-49: WARNING: atomic_add_unless

vim +420 fs/afs/file.c

6e0e99d58a6530 David Howells 2021-09-02  417  
6e0e99d58a6530 David Howells 2021-09-02  418  static void afs_drop_open_mmap(struct afs_vnode *vnode)
6e0e99d58a6530 David Howells 2021-09-02  419  {
275655d3207b9e Al Viro       2023-09-29 @420  	if (atomic_add_unless(&vnode->cb_nr_mmap, -1, 1))
6e0e99d58a6530 David Howells 2021-09-02  421  		return;
6e0e99d58a6530 David Howells 2021-09-02  422  
453924de6212ac David Howells 2023-11-08  423  	down_write(&vnode->volume->open_mmaps_lock);
6e0e99d58a6530 David Howells 2021-09-02  424  
275655d3207b9e Al Viro       2023-09-29  425  	read_seqlock_excl(&vnode->cb_lock);
275655d3207b9e Al Viro       2023-09-29  426  	// the only place where ->cb_nr_mmap may hit 0
275655d3207b9e Al Viro       2023-09-29  427  	// see __afs_break_callback() for the other side...
275655d3207b9e Al Viro       2023-09-29  428  	if (atomic_dec_and_test(&vnode->cb_nr_mmap))
6e0e99d58a6530 David Howells 2021-09-02  429  		list_del_init(&vnode->cb_mmap_link);
275655d3207b9e Al Viro       2023-09-29  430  	read_sequnlock_excl(&vnode->cb_lock);
6e0e99d58a6530 David Howells 2021-09-02  431  
453924de6212ac David Howells 2023-11-08  432  	up_write(&vnode->volume->open_mmaps_lock);
6e0e99d58a6530 David Howells 2021-09-02  433  	flush_work(&vnode->cb_work);
6e0e99d58a6530 David Howells 2021-09-02  434  }
6e0e99d58a6530 David Howells 2021-09-02  435  

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-05  8:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05  8:25 fs/afs/file.c:420:48-49: WARNING: atomic_add_unless kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).