From 80469a2878ec6b45718dc43edcb81b1a48aa7e5f Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Sun, 24 Jul 2011 15:45:34 -0400 Subject: [PATCH] --- yaml --- r: 260895 b: refs/heads/master c: 81317fdeddcef259b6ecf7b5c0d04caa167c6b54 h: refs/heads/master i: 260893: ff0e4e4eea3a76590a7e6fd61dd42f04809eda03 260891: 577e283575eb90ab5f664f3650d81da46e87f36e 260887: 338853f0541e666ce9aee04aa9fc080397818b52 260879: fae5ace2bd456c16d0edf68876d9a08a2cefafdd 260863: a1ab4332b0dce01ed582d44bb043b732beaf4e0d v: v3 --- [refs] | 2 +- trunk/fs/btrfs/transaction.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 13cdcd9acd1a..147a28a93852 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a65917156e345946dbde3d7effd28124c6d6a8c2 +refs/heads/master: 81317fdeddcef259b6ecf7b5c0d04caa167c6b54 diff --git a/trunk/fs/btrfs/transaction.c b/trunk/fs/btrfs/transaction.c index 654755b18951..eb55863bb4ae 100644 --- a/trunk/fs/btrfs/transaction.c +++ b/trunk/fs/btrfs/transaction.c @@ -497,10 +497,17 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, } if (lock && cur_trans->blocked && !cur_trans->in_commit) { - if (throttle) + if (throttle) { + /* + * We may race with somebody else here so end up having + * to call end_transaction on ourselves again, so inc + * our use_count. + */ + trans->use_count++; return btrfs_commit_transaction(trans, root); - else + } else { wake_up_process(info->transaction_kthread); + } } WARN_ON(cur_trans != info->running_transaction);