|
@@ -1087,7 +1087,13 @@ EXPORT_SYMBOL(do_splice_direct);
|
|
|
|
|
|
static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags)
|
|
static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags)
|
|
{
|
|
{
|
|
- while (pipe->nrbufs == pipe->buffers) {
|
|
|
|
|
|
+ for (;;) {
|
|
|
|
+ if (unlikely(!pipe->readers)) {
|
|
|
|
+ send_sig(SIGPIPE, current, 0);
|
|
|
|
+ return -EPIPE;
|
|
|
|
+ }
|
|
|
|
+ if (pipe->nrbufs != pipe->buffers)
|
|
|
|
+ return 0;
|
|
if (flags & SPLICE_F_NONBLOCK)
|
|
if (flags & SPLICE_F_NONBLOCK)
|
|
return -EAGAIN;
|
|
return -EAGAIN;
|
|
if (signal_pending(current))
|
|
if (signal_pending(current))
|
|
@@ -1096,7 +1102,6 @@ static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags)
|
|
pipe_wait(pipe);
|
|
pipe_wait(pipe);
|
|
pipe->waiting_writers--;
|
|
pipe->waiting_writers--;
|
|
}
|
|
}
|
|
- return 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
|
|
static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
|