diff options
author | David Sterba <dsterba@suse.com> | 2017-08-28 16:48:16 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-09-08 16:15:05 +0200 |
commit | 448999d84ddc2eaf36938176fb5091d2c2029e2f (patch) | |
tree | 4e90505605420f6d3467639d2899e93c893596dd /btrfs-zero-log.c | |
parent | 4ef5a112c9d2fe9d6f03ac2ea3aa5b1af0f37254 (diff) |
btrfs-progs: add crude error handling when transaction start fails
Currently transaction bugs out insided btrfs_start_transaction in case
of error, we want to lift the error handling to the callers. This patch
adds the BUG_ON anywhere it's been missing so far. This is not the best
way of course. Transforming BUG_ON to a proper error handling highly
depends on the caller and should be dealt with case by case.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-zero-log.c')
-rw-r--r-- | btrfs-zero-log.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/btrfs-zero-log.c b/btrfs-zero-log.c index 697026aa..2fce59e9 100644 --- a/btrfs-zero-log.c +++ b/btrfs-zero-log.c @@ -68,6 +68,7 @@ int main(int argc, char **argv) (unsigned long long)btrfs_super_log_root(sb), (unsigned)btrfs_super_log_root_level(sb)); trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); btrfs_set_super_log_root(root->fs_info->super_copy, 0); btrfs_set_super_log_root_level(root->fs_info->super_copy, 0); btrfs_commit_transaction(trans, root); |