splice: reinstate SIGPIPE/EPIPE handling
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 21 Dec 2016 18:59:34 +0000 (10:59 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jan 2017 09:40:12 +0000 (10:40 +0100)
commitb6cce9b8e8139e8b9130dd2efe950bac0d4fea50
tree4695de59132398d90c1378636e1cd3cbdc261dc4
parentc1df5a63716b0f73e95b1b26d878691e6175ea34
splice: reinstate SIGPIPE/EPIPE handling

commit 52bce91165e5f2db422b2b972e83d389e5e4725c upstream.

Commit 8924feff66f3 ("splice: lift pipe_lock out of splice_to_pipe()")
caused a regression when there were no more readers left on a pipe that
was being spliced into: rather than the expected SIGPIPE and -EPIPE
return value, the writer would end up waiting forever for space to free
up (which obviously was not going to happen with no readers around).

Fixes: 8924feff66f3 ("splice: lift pipe_lock out of splice_to_pipe()")
Reported-and-tested-by: Andreas Schwab <schwab@linux-m68k.org>
Debugged-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/splice.c