diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 2887b8be6fdd..b36eeef19194 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); |
@@ -2464,10 +2465,14 @@ int btrfs_commit_super(struct btrfs_root *root) | |||
2464 | up_write(&root->fs_info->cleanup_work_sem); | 2465 | up_write(&root->fs_info->cleanup_work_sem); |
2465 | 2466 | ||
2466 | trans = btrfs_join_transaction(root, 1); | 2467 | trans = btrfs_join_transaction(root, 1); |
2468 | if (IS_ERR(trans)) | ||
2469 | return PTR_ERR(trans); | ||
2467 | ret = btrfs_commit_transaction(trans, root); | 2470 | ret = btrfs_commit_transaction(trans, root); |
2468 | BUG_ON(ret); | 2471 | BUG_ON(ret); |
2469 | /* run commit again to drop the original snapshot */ | 2472 | /* run commit again to drop the original snapshot */ |
2470 | trans = btrfs_join_transaction(root, 1); | 2473 | trans = btrfs_join_transaction(root, 1); |
2474 | if (IS_ERR(trans)) | ||
2475 | return PTR_ERR(trans); | ||
2471 | btrfs_commit_transaction(trans, root); | 2476 | btrfs_commit_transaction(trans, root); |
2472 | ret = btrfs_write_and_wait_transaction(NULL, root); | 2477 | ret = btrfs_write_and_wait_transaction(NULL, root); |
2473 | BUG_ON(ret); | 2478 | BUG_ON(ret); |