Btrfs-progs: fix segfault when using tools fs with tree log
authorJosef Bacik <jbacik@fusionio.com>
Fri, 15 Mar 2013 21:13:08 +0000 (17:13 -0400)
committerDavid Sterba <dsterba@suse.cz>
Mon, 18 Mar 2013 18:41:58 +0000 (19:41 +0100)
commit0c7136f8e00078116662ea777163545a04eeb538
treeeeb93ba11cabfb300513ab0d859d3f34aee30d52
parent35ba8fc39eb413189c9f762afceaa8e991eb56e7
Btrfs-progs: fix segfault when using tools fs with tree log

We just free the log root after we set it up when we open a ctree in the tools.
This isn't nice, it makes double free's and leaks eb's, makes segfaults with
btrfs-image.  So fix this to be correct, and fix the cleanup if the buffer is
not uptodate.  With this fix I no longer segfault trying to do btrfs-image on a
file system with a log tree.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
disk-io.c