Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310820
b: refs/heads/master
c: 7b8b92a
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Jun 15, 2012
1 parent 7c19b35 commit 9a30152
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d7096fc3ef8360f30f228344bc564d4f97d8a158
refs/heads/master: 7b8b92af58db347de64a237861fcf13374b34a9c
10 changes: 8 additions & 2 deletions trunk/fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ static noinline int join_transaction(struct btrfs_root *root, int nofail)
kmem_cache_free(btrfs_transaction_cachep, cur_trans);
cur_trans = fs_info->running_transaction;
goto loop;
} else if (root->fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) {
spin_unlock(&root->fs_info->trans_lock);
kmem_cache_free(btrfs_transaction_cachep, cur_trans);
return -EROFS;
}

atomic_set(&cur_trans->num_writers, 1);
Expand Down Expand Up @@ -1213,12 +1217,14 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,


static void cleanup_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
struct btrfs_root *root, int err)
{
struct btrfs_transaction *cur_trans = trans->transaction;

WARN_ON(trans->use_count > 1);

btrfs_abort_transaction(trans, root, err);

spin_lock(&root->fs_info->trans_lock);
list_del_init(&cur_trans->list);
if (cur_trans == root->fs_info->running_transaction) {
Expand Down Expand Up @@ -1530,7 +1536,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
// WARN_ON(1);
if (current->journal_info == trans)
current->journal_info = NULL;
cleanup_transaction(trans, root);
cleanup_transaction(trans, root, ret);

return ret;
}
Expand Down

0 comments on commit 9a30152

Please sign in to comment.