Btrfs-progs: Add missing close_ctree() calls to debug-tree
authorFilipe David Borba Manana <fdmanana@gmail.com>
Mon, 10 Jun 2013 19:51:33 +0000 (20:51 +0100)
committerDavid Sterba <dsterba@suse.cz>
Fri, 9 Aug 2013 12:32:30 +0000 (14:32 +0200)
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
btrfs-debug-tree.c

index 97459b1c77849ec5085efa29b47bdad163808cda..74d4d66ee29be63b1969698970ea955a9daaf673 100644 (file)
@@ -195,10 +195,10 @@ int main(int ac, char **av)
                if (!leaf) {
                        fprintf(stderr, "failed to read %llu\n",
                                (unsigned long long)block_only);
-                       return 0;
+                       goto close_root;
                }
                btrfs_print_tree(root, leaf, 0);
-               return 0;
+               goto close_root;
        }
 
        if (!extent_only) {
@@ -370,7 +370,7 @@ no_node:
        }
 
        if (extent_only || device_only)
-               return 0;
+               goto close_root;
 
        if (root_backups)
                print_old_roots(info->super_copy);
@@ -383,5 +383,6 @@ no_node:
        uuid_unparse(info->super_copy->fsid, uuidbuf);
        printf("uuid %s\n", uuidbuf);
        printf("%s\n", BTRFS_BUILD_VERSION);
-       return 0;
+close_root:
+       return close_ctree(root);
 }