Message ID | 20181205093555.5386-52-sashal@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | None | expand |
On Wed, Dec 05, 2018 at 04:34:44AM -0500, Sasha Levin wrote: > From: Robbie Ko <robbieko@synology.com> > > [ Upstream commit a4390aee72713d9e73f1132bcdeb17d72fbbf974 ] ... > > Signed-off-by: Robbie Ko <robbieko@synology.com> > Reviewed-by: Filipe Manana <fdmanana@suse.com> > [Wrote changelog with example and more clear explanation] > Signed-off-by: Filipe Manana <fdmanana@suse.com> > Signed-off-by: David Sterba <dsterba@suse.com> > Signed-off-by: Sasha Levin <sashal@kernel.org> Ack for taking this patch to the stable trees. Thanks.
On Thu, Dec 06, 2018 at 06:55:19PM +0100, David Sterba wrote: >On Wed, Dec 05, 2018 at 04:34:44AM -0500, Sasha Levin wrote: >> From: Robbie Ko <robbieko@synology.com> >> >> [ Upstream commit a4390aee72713d9e73f1132bcdeb17d72fbbf974 ] >... >> >> Signed-off-by: Robbie Ko <robbieko@synology.com> >> Reviewed-by: Filipe Manana <fdmanana@suse.com> >> [Wrote changelog with example and more clear explanation] >> Signed-off-by: Filipe Manana <fdmanana@suse.com> >> Signed-off-by: David Sterba <dsterba@suse.com> >> Signed-off-by: Sasha Levin <sashal@kernel.org> > >Ack for taking this patch to the stable trees. Thanks. Thanks David. -- Thanks, Sasha
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index ba8950bfd9c7..84cb6e5ef36c 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -3344,7 +3344,8 @@ static void free_pending_move(struct send_ctx *sctx, struct pending_dir_move *m) kfree(m); } -static void tail_append_pending_moves(struct pending_dir_move *moves, +static void tail_append_pending_moves(struct send_ctx *sctx, + struct pending_dir_move *moves, struct list_head *stack) { if (list_empty(&moves->list)) { @@ -3355,6 +3356,10 @@ static void tail_append_pending_moves(struct pending_dir_move *moves, list_add_tail(&moves->list, stack); list_splice_tail(&list, stack); } + if (!RB_EMPTY_NODE(&moves->node)) { + rb_erase(&moves->node, &sctx->pending_dir_moves); + RB_CLEAR_NODE(&moves->node); + } } static int apply_children_dir_moves(struct send_ctx *sctx) @@ -3369,7 +3374,7 @@ static int apply_children_dir_moves(struct send_ctx *sctx) return 0; INIT_LIST_HEAD(&stack); - tail_append_pending_moves(pm, &stack); + tail_append_pending_moves(sctx, pm, &stack); while (!list_empty(&stack)) { pm = list_first_entry(&stack, struct pending_dir_move, list); @@ -3380,7 +3385,7 @@ static int apply_children_dir_moves(struct send_ctx *sctx) goto out; pm = get_pending_dir_moves(sctx, parent_ino); if (pm) - tail_append_pending_moves(pm, &stack); + tail_append_pending_moves(sctx, pm, &stack); } return 0;