All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android13-5.15-lts 2/2] fs/eventpoll.c:1009:2-11: second lock on line 994
@ 2026-10-25 20:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-25 20:48 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: cros-kernel-buildreports@googlegroups.com

tree:   https://android.googlesource.com/kernel/common android13-5.15-lts
head:   28ca5d8b733ed5c4ea847e57cc94f90cfa929e94
commit: 9208957e850335d35905a45e0041c09aac9ea5fb [2/2] UPSTREAM: eventpoll: kill __ep_remove()
:::::: branch date: 10 hours ago
:::::: commit date: 6 days ago
config: x86_64-randconfig-2102-20261025 (https://download.01.org/0day-ci/archive/20261025/202610252137.KYEUgiaP-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project a808f8ea7fdc61ead417bfe55e8ef5f728776aeb)

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/202610252137.KYEUgiaP-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/eventpoll.c:1009:2-11: second lock on line 994

vim +1009 fs/eventpoll.c

7699acd1341c63 Davide Libenzi    2007-05-10   976  
b611967de4dc5c Davide Libenzi    2006-10-11   977  /*
7699acd1341c63 Davide Libenzi    2007-05-10   978   * This is called from eventpoll_release() to unlink files from the eventpoll
7699acd1341c63 Davide Libenzi    2007-05-10   979   * interface. We need to have this facility to cleanup correctly files that are
7699acd1341c63 Davide Libenzi    2007-05-10   980   * closed without being removed from the eventpoll interface.
b611967de4dc5c Davide Libenzi    2006-10-11   981   */
7699acd1341c63 Davide Libenzi    2007-05-10   982  void eventpoll_release_file(struct file *file)
b611967de4dc5c Davide Libenzi    2006-10-11   983  {
7699acd1341c63 Davide Libenzi    2007-05-10   984  	struct eventpoll *ep;
44cdc1d952e3f7 Al Viro           2020-09-27   985  	struct epitem *epi;
f2451def095c17 Paolo Abeni       2023-03-22   986  	bool dispose;
f2451def095c17 Paolo Abeni       2023-03-22   987  
f2451def095c17 Paolo Abeni       2023-03-22   988  	/*
f2451def095c17 Paolo Abeni       2023-03-22   989  	 * Use the 'dying' flag to prevent a concurrent ep_clear_and_put() from
f2451def095c17 Paolo Abeni       2023-03-22   990  	 * touching the epitems list before eventpoll_release_file() can access
f2451def095c17 Paolo Abeni       2023-03-22   991  	 * the ep->mtx.
f2451def095c17 Paolo Abeni       2023-03-22   992  	 */
f2451def095c17 Paolo Abeni       2023-03-22   993  again:
f2451def095c17 Paolo Abeni       2023-03-22  @994  	spin_lock(&file->f_lock);
f2451def095c17 Paolo Abeni       2023-03-22   995  	if (file->f_ep && file->f_ep->first) {
f2451def095c17 Paolo Abeni       2023-03-22   996  		epi = hlist_entry(file->f_ep->first, struct epitem, fllink);
9208957e850335 Christian Brauner 2026-09-29   997  		WRITE_ONCE(epi->dying, true);
f2451def095c17 Paolo Abeni       2023-03-22   998  		spin_unlock(&file->f_lock);
f2451def095c17 Paolo Abeni       2023-03-22   999  
f2451def095c17 Paolo Abeni       2023-03-22  1000  		/*
f2451def095c17 Paolo Abeni       2023-03-22  1001  		 * ep access is safe as we still own a reference to the ep
f2451def095c17 Paolo Abeni       2023-03-22  1002  		 * struct
b611967de4dc5c Davide Libenzi    2006-10-11  1003  		 */
7699acd1341c63 Davide Libenzi    2007-05-10  1004  		ep = epi->ep;
f2451def095c17 Paolo Abeni       2023-03-22  1005  		mutex_lock(&ep->mtx);
9208957e850335 Christian Brauner 2026-09-29  1006  
9208957e850335 Christian Brauner 2026-09-29  1007  		ep_unregister_pollwait(ep, epi);
9208957e850335 Christian Brauner 2026-09-29  1008  
9208957e850335 Christian Brauner 2026-09-29 @1009  		spin_lock(&file->f_lock);
9208957e850335 Christian Brauner 2026-09-29  1010  		__ep_remove_file(ep, epi, file);
9208957e850335 Christian Brauner 2026-09-29  1011  		dispose = __ep_remove_epi(ep, epi);
9208957e850335 Christian Brauner 2026-09-29  1012  
d47de16c722196 Davide Libenzi    2007-05-15  1013  		mutex_unlock(&ep->mtx);
f2451def095c17 Paolo Abeni       2023-03-22  1014  
c36fff461c90c6 Linus Torvalds    2025-07-09  1015  		if (dispose && ep_refcount_dec_and_test(ep))
f2451def095c17 Paolo Abeni       2023-03-22  1016  			ep_free(ep);
f2451def095c17 Paolo Abeni       2023-03-22  1017  		goto again;
b611967de4dc5c Davide Libenzi    2006-10-11  1018  	}
f2451def095c17 Paolo Abeni       2023-03-22  1019  	spin_unlock(&file->f_lock);
b611967de4dc5c Davide Libenzi    2006-10-11  1020  }
b611967de4dc5c Davide Libenzi    2006-10-11  1021  

--
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:[~2026-10-25 20:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-25 20:48 [android-common:android13-5.15-lts 2/2] fs/eventpoll.c:1009:2-11: second lock on line 994 kernel test robot

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.