diff --git a/fs/pipe.c b/fs/pipe.c index 9841648c9cf3..e37c79935ecb 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -664,7 +664,8 @@ pipe_poll(struct file *filp, poll_table *wait) union pipe_index idx; /* Epoll has some historical nasty semantics, this enables them */ - WRITE_ONCE(pipe->poll_usage, true); + if (unlikely(!READ_ONCE(pipe->poll_usage))) + WRITE_ONCE(pipe->poll_usage, true); /* * Reading pipe state only -- no need for acquiring the semaphore.