summaryrefslogtreecommitdiff
path: root/kernel/locking/rtmutex-debug.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2014-03-06 19:01:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-22 16:49:21 -0700
commitdb1e4acb2454298b1784405732e8c49a62cd54c2 (patch)
tree0d1a323cbf17f9788f0b0d9e7066621cea3446d5 /kernel/locking/rtmutex-debug.c
parentef07f0440e3c1d4967b4556e274a8295e89687c3 (diff)
Btrfs: fix deadlock with nested trans handles
commit 3bbb24b20a8800158c33eca8564f432dd14d0bf3 upstream. Zach found this deadlock that would happen like this btrfs_end_transaction <- reduce trans->use_count to 0 btrfs_run_delayed_refs btrfs_cow_block find_free_extent btrfs_start_transaction <- increase trans->use_count to 1 allocate chunk btrfs_end_transaction <- decrease trans->use_count to 0 btrfs_run_delayed_refs lock tree block we are cowing above ^^ We need to only decrease trans->use_count if it is above 1, otherwise leave it alone. This will make nested trans be the only ones who decrease their added ref, and will let us get rid of the trans->use_count++ hack if we have to commit the transaction. Thanks, Reported-by: Zach Brown <zab@redhat.com> Signed-off-by: Josef Bacik <jbacik@fb.com> Tested-by: Zach Brown <zab@redhat.com> Signed-off-by: Chris Mason <clm@fb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/locking/rtmutex-debug.c')
0 files changed, 0 insertions, 0 deletions