aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ctree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index c274a752c93d..6932686b61cf 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2758,7 +2758,7 @@ int btrfs_search_old_slot(struct btrfs_root *root, struct btrfs_key *key,
2758 int level; 2758 int level;
2759 int lowest_unlock = 1; 2759 int lowest_unlock = 1;
2760 u8 lowest_level = 0; 2760 u8 lowest_level = 0;
2761 int prev_cmp; 2761 int prev_cmp = -1;
2762 2762
2763 lowest_level = p->lowest_level; 2763 lowest_level = p->lowest_level;
2764 WARN_ON(p->nodes[0] != NULL); 2764 WARN_ON(p->nodes[0] != NULL);
@@ -2769,7 +2769,6 @@ int btrfs_search_old_slot(struct btrfs_root *root, struct btrfs_key *key,
2769 } 2769 }
2770 2770
2771again: 2771again:
2772 prev_cmp = -1;
2773 b = get_old_root(root, time_seq); 2772 b = get_old_root(root, time_seq);
2774 level = btrfs_header_level(b); 2773 level = btrfs_header_level(b);
2775 p->locks[level] = BTRFS_READ_LOCK; 2774 p->locks[level] = BTRFS_READ_LOCK;
@@ -2787,6 +2786,11 @@ again:
2787 */ 2786 */
2788 btrfs_unlock_up_safe(p, level + 1); 2787 btrfs_unlock_up_safe(p, level + 1);
2789 2788
2789 /*
2790 * Since we can unwind eb's we want to do a real search every
2791 * time.
2792 */
2793 prev_cmp = -1;
2790 ret = key_search(b, key, level, &prev_cmp, &slot); 2794 ret = key_search(b, key, level, &prev_cmp, &slot);
2791 2795
2792 if (level != 0) { 2796 if (level != 0) {