Btrfs: return error code to caller when btrfs_del_item fails

The error code is returned instead of calling BUG_ON when
btrfs_del_item returns the error.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Tsutomu Itoh
2011-05-19 04:37:44 +00:00
committed by Chris Mason
parent b0b802d7e3
commit 65a246c5ff
4 changed files with 19 additions and 11 deletions

View File

@ -385,7 +385,10 @@ again:
*sequence = btrfs_root_ref_sequence(leaf, ref);
ret = btrfs_del_item(trans, tree_root, path);
BUG_ON(ret);
if (ret) {
err = ret;
goto out;
}
} else
err = -ENOENT;
@ -397,6 +400,7 @@ again:
goto again;
}
out:
btrfs_free_path(path);
return err;
}