Skip to contentSkip to conversation

epoll: fix suspicious RCU usage in ep_poll_callback

PATCH New Eric Wong 1 participant 1 message Mar 20, 2013 VFS

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 epoll: fix suspicious RCU usage in ep_poll_callback

The commit "epoll: use RCU to protect wakeup_source in epitem" introduced the ep_pm_stay_awake_rcu function for ep_poll_callback use, but I left it unused on accident. ep->mtx cannot be held in ep_poll_callback, so RCU should be used here.

Cc "Rafael J. Wysocki" <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Arve Hj�nnev�g <[email protected]>
Cc Davide Libenzi <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc NeilBrown <[email protected]>
Cc Oleg Nesterov <[email protected]>

---
Oops :x

 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/eventpoll.c +1 -1
index a4e4ad7..a81f0ea 100644
@@ -1028,7 +1028,7 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
 	/* If this file is already in the ready list we exit soon */
 	if (!ep_is_linked(&epi->rdllink)) {
 		list_add_tail(&epi->rdllink, &ep->rdllist);
-		ep_pm_stay_awake(epi);
+		ep_pm_stay_awake_rcu(epi);
 	}
 
 	/*
Signature · 1 line
Eric Wong