summaryrefslogtreecommitdiff
path: root/random-test.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-02-28 16:35:06 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-02-28 16:35:06 -0500
commit92ce8be1205795980188281de2399790e969cca5 (patch)
tree607076272485bca8c3dce03763cabee4b6a0fe29 /random-test.c
parent9b4f51240cfb9da74a17c8509e8d6ef8d1496ac4 (diff)
downloadbtrfs-progs-92ce8be1205795980188281de2399790e969cca5.tar.gz
return code checking
Diffstat (limited to 'random-test.c')
-rw-r--r--random-test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/random-test.c b/random-test.c
index 7078263..cebaf64 100644
--- a/random-test.c
+++ b/random-test.c
@@ -134,7 +134,7 @@ static int lookup_enoent(struct ctree_root *root, struct radix_tree_root *radix)
return ret;
ret = search_slot(root, &key, &path, 0);
release_path(root, &path);
- if (ret == 0)
+ if (ret <= 0)
goto error;
return 0;
error:
@@ -153,12 +153,17 @@ static int fill_radix(struct ctree_root *root, struct radix_tree_root *radix)
int ret;
int slot;
int i;
+
key.offset = 0;
key.flags = 0;
key.objectid = (unsigned long)-1;
while(1) {
init_path(&path);
ret = search_slot(root, &key, &path, 0);
+ if (ret < 0) {
+ release_path(root, &path);
+ return ret;
+ }
slot = path.slots[0];
if (ret != 0) {
if (slot == 0) {