Btrfs-progs: return an error if we can't find an fs root
authorJosef Bacik <jbacik@fusionio.com>
Fri, 1 Feb 2013 20:21:04 +0000 (15:21 -0500)
committerDavid Sterba <dsterba@suse.cz>
Thu, 7 Feb 2013 00:19:50 +0000 (01:19 +0100)
commit8a46573c2a6bc68385538e5d10131c984df198e9
tree015e56dbb591ce6defb594052162b3aca44203be
parent8795e785ced4b5931bb2c4548d390408fa65e21e
Btrfs-progs: return an error if we can't find an fs root

Instead of doing a BUG_ON() if we fail to find the last fs root just return
an error so the callers can deal with it how they like.  Also we need to
actually return an error if we can't find the latest root so that the error
handling works.  With this btrfsck was able to deal with a file system that
was missing a root item but still had extents that referred back to the
root.  Thanks,

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