diff options
author | Guillaume Knispel <gknispel@proformatique.com> | 2009-08-15 19:30:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-08 20:33:13 -0700 |
commit | 5638301d05015b68a5577bdf9c61813b3839fa1c (patch) | |
tree | 1e935b404dae7f620028e53edd07629e72ae0520 /fs | |
parent | c197608b8510c6a50ff643842374a799a9cba774 (diff) |
poll/select: initialize triggered field of struct poll_wqueues
commit b2add73dbf93fd50f00564d7abc3e2b9aa9dd20c upstream.
The triggered field of struct poll_wqueues introduced in commit
5f820f648c92a5ecc771a96b3c29aa6e90013bba ("poll: allow f_op->poll to
sleep").
It was first set to 1 in pollwake() (now __pollwake() ), tested and
later set to 0 in poll_schedule_timeout(), but not initialized before.
As a result when the process needs to sleep, triggered was likely to be
non-zero even if pollwake() is not called before the first
poll_schedule_timeout(), meaning schedule_hrtimeout_range() would not be
called and an extra loop calling all ->poll() would be done.
This patch initialize triggered to 0 in poll_initwait() so the ->poll()
are not called twice before the process goes to sleep when it needs to.
Signed-off-by: Guillaume Knispel <gknispel@proformatique.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/select.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/select.c b/fs/select.c index 0fe0e1469df3..6d76b825aa45 100644 --- a/fs/select.c +++ b/fs/select.c @@ -110,6 +110,7 @@ void poll_initwait(struct poll_wqueues *pwq) { init_poll_funcptr(&pwq->pt, __pollwait); pwq->polling_task = current; + pwq->triggered = 0; pwq->error = 0; pwq->table = NULL; pwq->inline_index = 0; |