diff options
-rw-r--r-- | fs/splice.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/splice.c b/fs/splice.c index 8890604e3fcd..6909d89d0da5 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -696,8 +696,10 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe, | |||
696 | return -EINVAL; | 696 | return -EINVAL; |
697 | 697 | ||
698 | more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0; | 698 | more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0; |
699 | if (sd->len < sd->total_len) | 699 | |
700 | if (sd->len < sd->total_len && pipe->nrbufs > 1) | ||
700 | more |= MSG_SENDPAGE_NOTLAST; | 701 | more |= MSG_SENDPAGE_NOTLAST; |
702 | |||
701 | return file->f_op->sendpage(file, buf->page, buf->offset, | 703 | return file->f_op->sendpage(file, buf->page, buf->offset, |
702 | sd->len, &pos, more); | 704 | sd->len, &pos, more); |
703 | } | 705 | } |