]> git.baikalelectronics.ru Git - kernel.git/commit
pipe: simplify signal handling in pipe_read() and add comments
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Dec 2019 19:46:19 +0000 (11:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Dec 2019 19:46:19 +0000 (11:46 -0800)
commitdcc82ec5a37c93eb52366b58c016e3aa70d165f7
tree138bfecd61e39cbe7492eaba1db0092d1e8cc8e7
parent471945968c835b73bc2399102ab8d0d705db339f
pipe: simplify signal handling in pipe_read() and add comments

There's no need to separately check for signals while inside the locked
region, since we're going to do "wait_event_interruptible()" right
afterwards anyway, and the error handling is much simpler there.

The check for whether we had already read anything was also redundant,
since we no longer do the odd merging of reads when there are pending
writers.

But perhaps more importantly, this adds commentary about why we still
need to wake up possible writers even though we didn't read any data,
and why we can skip all the finishing touches now if we get a signal (or
had a signal pending) while waiting for more data.

[ This is a split-out cleanup from my "make pipe IO use exclusive wait
  queues" thing, which I can't apply because it triggers a nasty bug in
  the GNU make jobserver   - Linus ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/pipe.c