Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349181
b: refs/heads/master
c: 2cba30f
h: refs/heads/master
i:
  349179: 8f26cb5
v: v3
  • Loading branch information
Miao Xie authored and Josef Bacik committed Jan 24, 2013
1 parent a0f4abd commit 87a23bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d25a086eb104297e3ba1fdd180b04cfaaa84797
refs/heads/master: 2cba30f172afdfa00f3e844f42f21eb3b972d01c
16 changes: 16 additions & 0 deletions trunk/fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
wait_event(cur_trans->writer_wait,
atomic_read(&cur_trans->num_writers) == 1);

/* ->aborted might be set after the previous check, so check it */
if (unlikely(ACCESS_ONCE(cur_trans->aborted))) {
ret = cur_trans->aborted;
goto cleanup_transaction;
}
/*
* the reloc mutex makes sure that we stop
* the balancing code from coming in and moving
Expand Down Expand Up @@ -1658,6 +1663,17 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
goto cleanup_transaction;
}

/*
* The tasks which save the space cache and inode cache may also
* update ->aborted, check it.
*/
if (unlikely(ACCESS_ONCE(cur_trans->aborted))) {
ret = cur_trans->aborted;
mutex_unlock(&root->fs_info->tree_log_mutex);
mutex_unlock(&root->fs_info->reloc_mutex);
goto cleanup_transaction;
}

btrfs_prepare_extent_commit(trans, root);

cur_trans = root->fs_info->running_transaction;
Expand Down

0 comments on commit 87a23bf

Please sign in to comment.