btrfs: fix end of tree detection when searching for data extent ref
[linux-2.6-block.git] / fs / btrfs / extent-tree.c
index 47d48233b592b4482ca3b7adb4d02c7da0a66300..3774c191e36dcfd04ffa0cdfcf81470d0b93cdfd 100644 (file)
@@ -477,7 +477,7 @@ again:
                if (path->slots[0] >= nritems) {
                        ret = btrfs_next_leaf(root, path);
                        if (ret) {
-                               if (ret > 1)
+                               if (ret > 0)
                                        return -ENOENT;
                                return ret;
                        }