diff --git a/cmds/send.c b/cmds/send.c index 006eb3cc..78315cfd 100644 --- a/cmds/send.c +++ b/cmds/send.c @@ -246,6 +246,7 @@ static int do_send(struct btrfs_send *send, u64 parent_root_id, void *t_err = NULL; int subvol_fd = -1; int pipefd[2] = {-1, -1}; + int pipesize = 1048576; subvol_fd = openat(send->mnt_fd, subvol, O_RDONLY | O_NOATIME); if (subvol_fd < 0) { @@ -265,8 +266,11 @@ static int do_send(struct btrfs_send *send, u64 parent_root_id, io_send.send_fd = pipefd[1]; send->send_fd = pipefd[0]; - if (!ret) + if (!ret) { + fcntl(pipefd[1], F_SETPIPE_SZ, &pipesize); + fcntl(pipefd[1], F_SETPIPE_SZ, &pipesize); ret = pthread_create(&t_read, NULL, read_sent_data, send); + } if (ret) { ret = -ret; errno = -ret;