summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/transaction.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 2d654c1c794d..43054285f638 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -147,18 +147,13 @@ static void wait_current_trans(struct btrfs_root *root)
while (1) {
prepare_to_wait(&root->fs_info->transaction_wait, &wait,
TASK_UNINTERRUPTIBLE);
- if (cur_trans->blocked) {
- mutex_unlock(&root->fs_info->trans_mutex);
- schedule();
- mutex_lock(&root->fs_info->trans_mutex);
- finish_wait(&root->fs_info->transaction_wait,
- &wait);
- } else {
- finish_wait(&root->fs_info->transaction_wait,
- &wait);
+ if (!cur_trans->blocked)
break;
- }
+ mutex_unlock(&root->fs_info->trans_mutex);
+ schedule();
+ mutex_lock(&root->fs_info->trans_mutex);
}
+ finish_wait(&root->fs_info->transaction_wait, &wait);
put_transaction(cur_trans);
}
}