diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index c346d320173a..66e4c66cc63b 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1063,9 +1063,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
1063 | snap_pending = 1; | 1063 | snap_pending = 1; |
1064 | 1064 | ||
1065 | WARN_ON(cur_trans != trans->transaction); | 1065 | WARN_ON(cur_trans != trans->transaction); |
1066 | prepare_to_wait(&cur_trans->writer_wait, &wait, | ||
1067 | TASK_UNINTERRUPTIBLE); | ||
1068 | |||
1069 | if (cur_trans->num_writers > 1) | 1066 | if (cur_trans->num_writers > 1) |
1070 | timeout = MAX_SCHEDULE_TIMEOUT; | 1067 | timeout = MAX_SCHEDULE_TIMEOUT; |
1071 | else if (should_grow) | 1068 | else if (should_grow) |
@@ -1088,6 +1085,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
1088 | */ | 1085 | */ |
1089 | btrfs_run_ordered_operations(root, 1); | 1086 | btrfs_run_ordered_operations(root, 1); |
1090 | 1087 | ||
1088 | prepare_to_wait(&cur_trans->writer_wait, &wait, | ||
1089 | TASK_UNINTERRUPTIBLE); | ||
1090 | |||
1091 | smp_mb(); | 1091 | smp_mb(); |
1092 | if (cur_trans->num_writers > 1 || should_grow) | 1092 | if (cur_trans->num_writers > 1 || should_grow) |
1093 | schedule_timeout(timeout); | 1093 | schedule_timeout(timeout); |