summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/splice.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 8ed7c9d8c0fb..873d83104e79 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1087,7 +1087,13 @@ EXPORT_SYMBOL(do_splice_direct);
1087 1087
1088static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags) 1088static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags)
1089{ 1089{
1090 while (pipe->nrbufs == pipe->buffers) { 1090 for (;;) {
1091 if (unlikely(!pipe->readers)) {
1092 send_sig(SIGPIPE, current, 0);
1093 return -EPIPE;
1094 }
1095 if (pipe->nrbufs != pipe->buffers)
1096 return 0;
1091 if (flags & SPLICE_F_NONBLOCK) 1097 if (flags & SPLICE_F_NONBLOCK)
1092 return -EAGAIN; 1098 return -EAGAIN;
1093 if (signal_pending(current)) 1099 if (signal_pending(current))
@@ -1096,7 +1102,6 @@ static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags)
1096 pipe_wait(pipe); 1102 pipe_wait(pipe);
1097 pipe->waiting_writers--; 1103 pipe->waiting_writers--;
1098 } 1104 }
1099 return 0;
1100} 1105}
1101 1106
1102static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe, 1107static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,