From: David Sterba Date: Tue, 23 Aug 2016 17:24:48 +0000 (+0200) Subject: btrfs-progs: convert: improve error hanling of init_btrfs X-Git-Tag: upstream/4.16.1~1351 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4a6c73aac2abfa828fdf06ae617c33b3758404b;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: convert: improve error hanling of init_btrfs Replace BUG_ONs and verbosely report the errors. Signed-off-by: David Sterba --- diff --git a/btrfs-convert.c b/btrfs-convert.c index 66f62e8..d2ff517 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -1298,7 +1298,11 @@ static int init_btrfs(struct btrfs_mkfs_config *cfg, struct btrfs_root *root, fs_info->avoid_sys_chunk_alloc = 1; fs_info->avoid_meta_chunk_alloc = 1; trans = btrfs_start_transaction(root, 1); - BUG_ON(!trans); + if (!trans) { + error("unable to start transaction"); + ret = -EINVAL; + goto err; + } ret = btrfs_fix_block_accounting(trans, root); if (ret) goto err;