Linus Torvalds ad910e36da pipe: fix poll/select race introduced by the pipe rework
The kernel wait queues have a basic rule to them: you add yourself to
the wait-queue first, and then you check the things that you're going to
wait on.  That avoids the races with the event you're waiting for.

The same goes for poll/select logic: the "poll_wait()" goes first, and
then you check the things you're polling for.

Of course, if you use locking, the ordering doesn't matter since the
lock will serialize with anything that changes the state you're looking
at. That's not the case here, though.

So move the poll_wait() first in pipe_poll(), before you start looking
at the pipe state.

Fixes: 8cefc107ca54 ("pipe: Use head and tail pointers for the ring, not cursor and length")
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-12-07 10:41:17 -08:00
2019-12-06 16:12:39 -08:00
2019-12-06 13:36:31 -08:00
2019-12-06 14:19:37 -08:00
2019-12-06 14:19:37 -08:00
2019-12-04 19:44:13 -08:00
2019-11-15 14:38:27 +01:00
2019-12-05 12:27:16 -08:00
2019-12-05 11:43:31 -08:00
2019-12-06 10:08:59 -08:00
2019-11-27 11:42:01 -08:00
2019-12-03 12:51:35 -08:00
2019-12-06 13:06:14 -08:00
2019-12-04 19:44:13 -08:00
2019-12-05 13:18:54 -08:00
2019-10-29 04:43:29 -06:00
2019-12-06 14:19:37 -08:00
2019-12-02 17:35:04 -08:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 5.7 GiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%