diff options
-rw-r--r-- | fs/btrfs/transaction.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 654755b18951..eb55863bb4ae 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -497,10 +497,17 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, | |||
497 | } | 497 | } |
498 | 498 | ||
499 | if (lock && cur_trans->blocked && !cur_trans->in_commit) { | 499 | if (lock && cur_trans->blocked && !cur_trans->in_commit) { |
500 | if (throttle) | 500 | if (throttle) { |
501 | /* | ||
502 | * We may race with somebody else here so end up having | ||
503 | * to call end_transaction on ourselves again, so inc | ||
504 | * our use_count. | ||
505 | */ | ||
506 | trans->use_count++; | ||
501 | return btrfs_commit_transaction(trans, root); | 507 | return btrfs_commit_transaction(trans, root); |
502 | else | 508 | } else { |
503 | wake_up_process(info->transaction_kthread); | 509 | wake_up_process(info->transaction_kthread); |
510 | } | ||
504 | } | 511 | } |
505 | 512 | ||
506 | WARN_ON(cur_trans != info->running_transaction); | 513 | WARN_ON(cur_trans != info->running_transaction); |