@@ -471,7 +471,7 @@ static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_des
* Check for signal early to make process killable when there are
* always buffers available
*/
- if (signal_pending(current))
+ if (signal_pending(current) && !sd->ignore_sig)
return -ERESTARTSYS;
repeat:
@@ -485,7 +485,7 @@ static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_des
if (sd->flags & SPLICE_F_NONBLOCK)
return -EAGAIN;
- if (signal_pending(current))
+ if (signal_pending(current) && !sd->ignore_sig)
return -ERESTARTSYS;
if (sd->need_wakeup) {
@@ -64,6 +64,7 @@ struct splice_desc {
loff_t *opos; /* sendfile: output position */
size_t num_spliced; /* number of bytes already spliced */
bool need_wakeup; /* need to wake up writer */
+ bool ignore_sig;
};
struct partial_page {
__splice_from_pipe() is used for splice data from pipe, and the actor could be simply grabbing pages, so if the caller can confirm this actor won't block, it isn't necessary to return -ERESTARTSYS. Signed-off-by: Ming Lei <ming.lei@redhat.com> --- fs/splice.c | 4 ++-- include/linux/splice.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)