Btrfs: log recovery, don't unlink inode always on error
authorFilipe David Borba Manana <fdmanana@gmail.com>
Mon, 28 Oct 2013 17:39:21 +0000 (17:39 +0000)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 03:10:48 +0000 (22:10 -0500)
commit269d040ff2f340e1ed517dab8b66b2f133c83a77
treecbbcf1d4fbda2043a88e7e4bf41c12dae4e92122
parent488111aa0e17102d42e0328299fd782dc6a4a051
Btrfs: log recovery, don't unlink inode always on error

If we get any error while doing a dir index/item lookup in the
log tree, we were always unlinking the corresponding inode in
the subvolume. It makes sense to unlink only if the lookup failed
to find the dir index/item, which corresponds to NULL or -ENOENT,
and not when other errors happen (like a transient -ENOMEM or -EIO).

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/tree-log.c