提交 6cc98d90 编写于 作者: J Josef Bacik 提交者: Chris Mason

Btrfs: fix assert screwup for the pending move stuff

Wang noticed that he was failing btrfs/030 even though me and Filipe couldn't
reproduce.  Turns out this is because Wang didn't have CONFIG_BTRFS_ASSERT set,
which meant that a key part of Filipe's original patch was not being built in.
This appears to be a mess up with merging Filipe's patch as it does not exist in
his original patch.  Fix this by changing how we make sure del_waiting_dir_move
asserts that it did not error and take the function out of the ifdef check.
This makes btrfs/030 pass with the assert on or off.  Thanks,
Signed-off-by: NJosef Bacik <jbacik@fb.com>
Reviewed-by: NFilipe Manana <fdmanana@gmail.com>
Signed-off-by: NChris Mason <clm@fb.com>
上级 60efa5eb
...@@ -2774,8 +2774,6 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino) ...@@ -2774,8 +2774,6 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino)
return 0; return 0;
} }
#ifdef CONFIG_BTRFS_ASSERT
static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino) static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino)
{ {
struct rb_node *n = sctx->waiting_dir_moves.rb_node; struct rb_node *n = sctx->waiting_dir_moves.rb_node;
...@@ -2796,8 +2794,6 @@ static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino) ...@@ -2796,8 +2794,6 @@ static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino)
return -ENOENT; return -ENOENT;
} }
#endif
static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino) static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino)
{ {
struct rb_node **p = &sctx->pending_dir_moves.rb_node; struct rb_node **p = &sctx->pending_dir_moves.rb_node;
...@@ -2902,7 +2898,9 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) ...@@ -2902,7 +2898,9 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm)
} }
sctx->send_progress = sctx->cur_ino + 1; sctx->send_progress = sctx->cur_ino + 1;
ASSERT(del_waiting_dir_move(sctx, pm->ino) == 0); ret = del_waiting_dir_move(sctx, pm->ino);
ASSERT(ret == 0);
ret = get_cur_path(sctx, pm->ino, pm->gen, to_path); ret = get_cur_path(sctx, pm->ino, pm->gen, to_path);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册