diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b531c36455d8..fdce8799b98d 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1550,6 +1550,7 @@ static int transaction_kthread(void *arg) | |||
1550 | spin_unlock(&root->fs_info->new_trans_lock); | 1550 | spin_unlock(&root->fs_info->new_trans_lock); |
1551 | 1551 | ||
1552 | trans = btrfs_join_transaction(root, 1); | 1552 | trans = btrfs_join_transaction(root, 1); |
1553 | BUG_ON(IS_ERR(trans)); | ||
1553 | if (transid == trans->transid) { | 1554 | if (transid == trans->transid) { |
1554 | ret = btrfs_commit_transaction(trans, root); | 1555 | ret = btrfs_commit_transaction(trans, root); |
1555 | BUG_ON(ret); | 1556 | BUG_ON(ret); |
@@ -2453,10 +2454,14 @@ int btrfs_commit_super(struct btrfs_root *root) | |||
2453 | up_write(&root->fs_info->cleanup_work_sem); | 2454 | up_write(&root->fs_info->cleanup_work_sem); |
2454 | 2455 | ||
2455 | trans = btrfs_join_transaction(root, 1); | 2456 | trans = btrfs_join_transaction(root, 1); |
2457 | if (IS_ERR(trans)) | ||
2458 | return PTR_ERR(trans); | ||
2456 | ret = btrfs_commit_transaction(trans, root); | 2459 | ret = btrfs_commit_transaction(trans, root); |
2457 | BUG_ON(ret); | 2460 | BUG_ON(ret); |
2458 | /* run commit again to drop the original snapshot */ | 2461 | /* run commit again to drop the original snapshot */ |
2459 | trans = btrfs_join_transaction(root, 1); | 2462 | trans = btrfs_join_transaction(root, 1); |
2463 | if (IS_ERR(trans)) | ||
2464 | return PTR_ERR(trans); | ||
2460 | btrfs_commit_transaction(trans, root); | 2465 | btrfs_commit_transaction(trans, root); |
2461 | ret = btrfs_write_and_wait_transaction(NULL, root); | 2466 | ret = btrfs_write_and_wait_transaction(NULL, root); |
2462 | BUG_ON(ret); | 2467 | BUG_ON(ret); |
@@ -2554,6 +2559,8 @@ int close_ctree(struct btrfs_root *root) | |||
2554 | kfree(fs_info->chunk_root); | 2559 | kfree(fs_info->chunk_root); |
2555 | kfree(fs_info->dev_root); | 2560 | kfree(fs_info->dev_root); |
2556 | kfree(fs_info->csum_root); | 2561 | kfree(fs_info->csum_root); |
2562 | kfree(fs_info); | ||
2563 | |||
2557 | return 0; | 2564 | return 0; |
2558 | } | 2565 | } |
2559 | 2566 | ||