Josef Bacik 81317fdedd Btrfs: fix deadlock when throttling transactions
Hit this nice little deadlock.  What happens is this

__btrfs_end_transaction with throttle set, --use_count so it equals 0
  btrfs_commit_transaction
    <somebody else actually manages to start the commit>
    btrfs_end_transaction --use_count so now its -1 <== BAD
      we just return and wait on the transaction

This is bad because we just return after our use_count is -1 and don't let go
of our num_writer count on the transaction, so the guy committing the
transaction just sits there forever.  Fix this by inc'ing our use_count if we're
going to call commit_transaction so that if we call btrfs_end_transaction it's
valid.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-07-27 12:46:46 -04:00
..
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-10 08:52:07 +01:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-01-14 09:23:36 -08:00
2011-04-25 18:14:10 -07:00
2011-01-12 20:03:42 -05:00
2011-05-09 09:04:24 -07:00
2011-01-07 17:50:26 +11:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-01-07 17:50:26 +11:00
2011-03-31 11:26:23 -03:00
2011-03-10 08:52:07 +01:00
2011-04-14 16:06:56 -07:00
2011-03-31 11:26:23 -03:00
2011-01-07 17:50:26 +11:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-10-29 04:16:28 -04:00
2011-03-31 11:26:23 -03:00
2011-04-25 18:14:10 -07:00
2011-03-31 11:26:23 -03:00
2011-03-21 00:16:09 -04:00
2011-03-31 11:26:23 -03:00
2011-04-05 23:51:48 +02:00
2011-03-21 00:16:08 -04:00
2011-03-31 11:26:23 -03:00
2011-03-10 08:52:26 +01:00
2011-03-21 01:10:41 -04:00
2011-01-07 17:50:33 +11:00
2011-03-14 09:15:28 -04:00
2011-04-21 07:34:44 -07:00