diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index f34205569987..7bc4477d7ee7 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2490,7 +2490,9 @@ again: else { ret = find_dir_range(log, path, dirid, key_type, &range_start, &range_end); - if (ret != 0) + if (ret < 0) + goto out; + else if (ret > 0) break; }