From 448999d84ddc2eaf36938176fb5091d2c2029e2f Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 28 Aug 2017 16:48:16 +0200 Subject: 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 --- cmds-rescue.c | 1 + 1 file changed, 1 insertion(+) (limited to 'cmds-rescue.c') diff --git a/cmds-rescue.c b/cmds-rescue.c index 7e7344ee..d1bec021 100644 --- a/cmds-rescue.c +++ b/cmds-rescue.c @@ -191,6 +191,7 @@ static int cmd_rescue_zero_log(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(sb, 0); btrfs_set_super_log_root_level(sb, 0); btrfs_commit_transaction(trans, root); -- cgit v1.2.3