diff --git a/common/filesystem-utils.c b/common/filesystem-utils.c index 8c159365..66269ad9 100644 --- a/common/filesystem-utils.c +++ b/common/filesystem-utils.c @@ -98,7 +98,10 @@ static int set_label_unmounted(const char *dev, const char *label) return -1; trans = btrfs_start_transaction(root, 1); - BUG_ON(IS_ERR(trans)); + if (IS_ERR(trans)) { + error_msg(ERROR_MSG_START_TRANS, "set label"); + return PTR_ERR(trans); + } __strncpy_null(root->fs_info->super_copy->label, label, BTRFS_LABEL_SIZE - 1); btrfs_commit_transaction(trans, root);