struct extent_buffer *cur;
struct btrfs_key found_key;
int slot;
+ int sret;
u32 nritems;
int level;
int ret = 1;
while(1) {
nritems = btrfs_header_nritems(cur);
level = btrfs_header_level(cur);
- bin_search(cur, min_key, level, &slot);
+ sret = bin_search(cur, min_key, level, &slot);
/* at level = 0, we're done, setup the path and exit */
if (level == 0) {
btrfs_item_key_to_cpu(cur, &found_key, slot);
goto out;
}
+ if (sret && slot > 0)
+ slot--;
/*
* check this node pointer against the cache_only and
* min_trans parameters. If it isn't in cache or is too