aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-05-31 15:49:57 -0400
committerChris Mason <chris.mason@oracle.com>2012-06-14 21:29:12 -0400
commitd7096fc3ef8360f30f228344bc564d4f97d8a158 (patch)
treec6a44d0b1cfc13d2449cf0d8ff8b7bae06bf0df1 /fs/btrfs/disk-io.c
parentb939d1ab76b4aa816343cdbd8b44ce9929a3b9ef (diff)
Btrfs: wake up transaction waiters when aborting a transaction
I was getting lots of hung tasks and a NULL pointer dereference because we are not cleaning up the transaction properly when it aborts. First we need to reset the running_transaction to NULL so we don't get a bad dereference for any start_transaction callers after this. Also we cannot rely on waitqueue_active() since it's just a list_empty(), so just call wake_up() directly since that will do the barrier for us and such. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c79ddc756081..19b4db70dcb1 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3589,16 +3589,13 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans,
3589 /* FIXME: cleanup wait for commit */ 3589 /* FIXME: cleanup wait for commit */
3590 cur_trans->in_commit = 1; 3590 cur_trans->in_commit = 1;
3591 cur_trans->blocked = 1; 3591 cur_trans->blocked = 1;
3592 if (waitqueue_active(&root->fs_info->transaction_blocked_wait)) 3592 wake_up(&root->fs_info->transaction_blocked_wait);
3593 wake_up(&root->fs_info->transaction_blocked_wait);
3594 3593
3595 cur_trans->blocked = 0; 3594 cur_trans->blocked = 0;
3596 if (waitqueue_active(&root->fs_info->transaction_wait)) 3595 wake_up(&root->fs_info->transaction_wait);
3597 wake_up(&root->fs_info->transaction_wait);
3598 3596
3599 cur_trans->commit_done = 1; 3597 cur_trans->commit_done = 1;
3600 if (waitqueue_active(&cur_trans->commit_wait)) 3598 wake_up(&cur_trans->commit_wait);
3601 wake_up(&cur_trans->commit_wait);
3602 3599
3603 btrfs_destroy_pending_snapshots(cur_trans); 3600 btrfs_destroy_pending_snapshots(cur_trans);
3604 3601