diff options
author | David Sterba <dsterba@suse.com> | 2016-08-23 19:24:48 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-08-24 14:37:36 +0200 |
commit | d4a6c73aac2abfa828fdf06ae617c33b3758404b (patch) | |
tree | ae1b31043f370458379d254105390aa297ef11d1 /btrfs-convert.c | |
parent | 60e45f8aa336bf11e0f6838e79887a34d7306dbd (diff) |
btrfs-progs: convert: improve error hanling of init_btrfs
Replace BUG_ONs and verbosely report the errors.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-convert.c')
-rw-r--r-- | btrfs-convert.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c index 66f62e80..d2ff5177 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; |