summaryrefslogtreecommitdiff
path: root/fs/btrfs/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
commitaa5d6bed255d7f8c655a8f10d760f4247bc8385c (patch)
treeddd4ad69b490fc49e23097f5d783ef90ea81cf5f /fs/btrfs/random-test.c
parentaf86d07efe83e2f2da3658702a720bc48b1a6d78 (diff)
Btrfs: return code checking
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/random-test.c')
-rw-r--r--fs/btrfs/random-test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/random-test.c b/fs/btrfs/random-test.c
index 7078263acc3d..cebaf6483927 100644
--- a/fs/btrfs/random-test.c
+++ b/fs/btrfs/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) {