diff options
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r-- | fs/btrfs/send.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 98e9e0cf7e8e..c2bfd60ba245 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -3055,33 +3055,18 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) | |||
3055 | if (ret < 0) | 3055 | if (ret < 0) |
3056 | goto out; | 3056 | goto out; |
3057 | 3057 | ||
3058 | if (parent_ino == sctx->cur_ino) { | 3058 | ret = get_cur_path(sctx, parent_ino, parent_gen, |
3059 | /* child only renamed, not moved */ | 3059 | from_path); |
3060 | ASSERT(parent_gen == sctx->cur_inode_gen); | 3060 | if (ret < 0) |
3061 | ret = get_cur_path(sctx, sctx->cur_ino, sctx->cur_inode_gen, | 3061 | goto out; |
3062 | from_path); | 3062 | ret = fs_path_add_path(from_path, name); |
3063 | if (ret < 0) | 3063 | if (ret < 0) |
3064 | goto out; | 3064 | goto out; |
3065 | ret = fs_path_add_path(from_path, name); | ||
3066 | if (ret < 0) | ||
3067 | goto out; | ||
3068 | } else { | ||
3069 | /* child moved and maybe renamed too */ | ||
3070 | sctx->send_progress = pm->ino; | ||
3071 | ret = get_cur_path(sctx, pm->ino, pm->gen, from_path); | ||
3072 | if (ret < 0) | ||
3073 | goto out; | ||
3074 | } | ||
3075 | 3065 | ||
3076 | fs_path_free(name); | 3066 | fs_path_reset(name); |
3067 | to_path = name; | ||
3077 | name = NULL; | 3068 | name = NULL; |
3078 | 3069 | ||
3079 | to_path = fs_path_alloc(); | ||
3080 | if (!to_path) { | ||
3081 | ret = -ENOMEM; | ||
3082 | goto out; | ||
3083 | } | ||
3084 | |||
3085 | sctx->send_progress = sctx->cur_ino + 1; | 3070 | sctx->send_progress = sctx->cur_ino + 1; |
3086 | ret = get_cur_path(sctx, pm->ino, pm->gen, to_path); | 3071 | ret = get_cur_path(sctx, pm->ino, pm->gen, to_path); |
3087 | if (ret < 0) | 3072 | if (ret < 0) |