diff options
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r-- | fs/btrfs/send.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index c85e7c6b4598..ff40f1c00ce3 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -387,7 +387,7 @@ static struct btrfs_path *alloc_path_for_send(void) | |||
387 | return path; | 387 | return path; |
388 | } | 388 | } |
389 | 389 | ||
390 | int write_buf(struct file *filp, const void *buf, u32 len, loff_t *off) | 390 | static int write_buf(struct file *filp, const void *buf, u32 len, loff_t *off) |
391 | { | 391 | { |
392 | int ret; | 392 | int ret; |
393 | mm_segment_t old_fs; | 393 | mm_segment_t old_fs; |
@@ -3479,7 +3479,6 @@ static int __process_changed_new_xattr(int num, struct btrfs_key *di_key, | |||
3479 | struct send_ctx *sctx = ctx; | 3479 | struct send_ctx *sctx = ctx; |
3480 | char *found_data = NULL; | 3480 | char *found_data = NULL; |
3481 | int found_data_len = 0; | 3481 | int found_data_len = 0; |
3482 | struct fs_path *p = NULL; | ||
3483 | 3482 | ||
3484 | ret = find_xattr(sctx, sctx->parent_root, sctx->right_path, | 3483 | ret = find_xattr(sctx, sctx->parent_root, sctx->right_path, |
3485 | sctx->cmp_key, name, name_len, &found_data, | 3484 | sctx->cmp_key, name, name_len, &found_data, |
@@ -3498,7 +3497,6 @@ static int __process_changed_new_xattr(int num, struct btrfs_key *di_key, | |||
3498 | } | 3497 | } |
3499 | 3498 | ||
3500 | kfree(found_data); | 3499 | kfree(found_data); |
3501 | fs_path_free(sctx, p); | ||
3502 | return ret; | 3500 | return ret; |
3503 | } | 3501 | } |
3504 | 3502 | ||
@@ -4529,9 +4527,11 @@ static int send_subvol(struct send_ctx *sctx) | |||
4529 | { | 4527 | { |
4530 | int ret; | 4528 | int ret; |
4531 | 4529 | ||
4532 | ret = send_header(sctx); | 4530 | if (!(sctx->flags & BTRFS_SEND_FLAG_OMIT_STREAM_HEADER)) { |
4533 | if (ret < 0) | 4531 | ret = send_header(sctx); |
4534 | goto out; | 4532 | if (ret < 0) |
4533 | goto out; | ||
4534 | } | ||
4535 | 4535 | ||
4536 | ret = send_subvol_begin(sctx); | 4536 | ret = send_subvol_begin(sctx); |
4537 | if (ret < 0) | 4537 | if (ret < 0) |
@@ -4593,7 +4593,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) | |||
4593 | goto out; | 4593 | goto out; |
4594 | } | 4594 | } |
4595 | 4595 | ||
4596 | if (arg->flags & ~BTRFS_SEND_FLAG_NO_FILE_DATA) { | 4596 | if (arg->flags & ~BTRFS_SEND_FLAG_MASK) { |
4597 | ret = -EINVAL; | 4597 | ret = -EINVAL; |
4598 | goto out; | 4598 | goto out; |
4599 | } | 4599 | } |
@@ -4612,8 +4612,8 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) | |||
4612 | sctx->flags = arg->flags; | 4612 | sctx->flags = arg->flags; |
4613 | 4613 | ||
4614 | sctx->send_filp = fget(arg->send_fd); | 4614 | sctx->send_filp = fget(arg->send_fd); |
4615 | if (IS_ERR(sctx->send_filp)) { | 4615 | if (!sctx->send_filp) { |
4616 | ret = PTR_ERR(sctx->send_filp); | 4616 | ret = -EBADF; |
4617 | goto out; | 4617 | goto out; |
4618 | } | 4618 | } |
4619 | 4619 | ||
@@ -4704,12 +4704,14 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) | |||
4704 | if (ret < 0) | 4704 | if (ret < 0) |
4705 | goto out; | 4705 | goto out; |
4706 | 4706 | ||
4707 | ret = begin_cmd(sctx, BTRFS_SEND_C_END); | 4707 | if (!(sctx->flags & BTRFS_SEND_FLAG_OMIT_END_CMD)) { |
4708 | if (ret < 0) | 4708 | ret = begin_cmd(sctx, BTRFS_SEND_C_END); |
4709 | goto out; | 4709 | if (ret < 0) |
4710 | ret = send_cmd(sctx); | 4710 | goto out; |
4711 | if (ret < 0) | 4711 | ret = send_cmd(sctx); |
4712 | goto out; | 4712 | if (ret < 0) |
4713 | goto out; | ||
4714 | } | ||
4713 | 4715 | ||
4714 | out: | 4716 | out: |
4715 | kfree(arg); | 4717 | kfree(arg); |