aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2014-02-05 16:19:21 -0500
committerChris Mason <clm@fb.com>2014-02-08 20:57:15 -0500
commit6cc98d90f8d14f8ebce2391323929024d7eef39f (patch)
tree284741c93027de860d6e13098608578d52085920 /fs
parent60efa5eb2e886852a0d5f9e1ffa7c896a1099da8 (diff)
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: Josef Bacik <jbacik@fb.com> Reviewed-by: Filipe Manana <fdmanana@gmail.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/send.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index cf9107a64204..9c8d1a3fdc3a 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -2774,8 +2774,6 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino)
2774 return 0; 2774 return 0;
2775} 2775}
2776 2776
2777#ifdef CONFIG_BTRFS_ASSERT
2778
2779static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino) 2777static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino)
2780{ 2778{
2781 struct rb_node *n = sctx->waiting_dir_moves.rb_node; 2779 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 return -ENOENT; 2794 return -ENOENT;
2797} 2795}
2798 2796
2799#endif
2800
2801static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino) 2797static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino)
2802{ 2798{
2803 struct rb_node **p = &sctx->pending_dir_moves.rb_node; 2799 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 } 2898 }
2903 2899
2904 sctx->send_progress = sctx->cur_ino + 1; 2900 sctx->send_progress = sctx->cur_ino + 1;
2905 ASSERT(del_waiting_dir_move(sctx, pm->ino) == 0); 2901 ret = del_waiting_dir_move(sctx, pm->ino);
2902 ASSERT(ret == 0);
2903
2906 ret = get_cur_path(sctx, pm->ino, pm->gen, to_path); 2904 ret = get_cur_path(sctx, pm->ino, pm->gen, to_path);
2907 if (ret < 0) 2905 if (ret < 0)
2908 goto out; 2906 goto out;