]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix deadlock in wait_for_more_refs
authorArne Jansen <sensille@gmx.net>
Mon, 6 Aug 2012 20:18:51 +0000 (14:18 -0600)
committerChris Mason <chris.mason@oracle.com>
Tue, 28 Aug 2012 20:53:32 +0000 (16:53 -0400)
commit4d15af93f3d9c151eca1ad4c0ea2ddbc71282409
tree9b8e80ef9ef0479d270d46b46c4ca7d0106d3ae0
parent38cbb92ed2170b44d6ccd3e9a7f7384e859ec6e8
Btrfs: fix deadlock in wait_for_more_refs

Commit f5f5457b introduced a waiting mechanism to prevent busy waiting in
btrfs_run_delayed_refs. This can deadlock with btrfs_run_ordered_operations,
where a tree_mod_seq is held while waiting for the io to complete, while
the end_io calls btrfs_run_delayed_refs.
This whole mechanism is unnecessary. If not enough runnable refs are
available to satisfy count, just return as count is more like a guideline
than a strict requirement.
In case we have to run all refs, commit transaction makes sure that no
other threads are working in the transaction anymore, so we just assert
here that no refs are blocked.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/delayed-ref.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c