diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2009-11-12 04:36:34 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-12-17 12:33:35 -0500 |
commit | 24bbcf0442ee04660a5a030efdbb6d03f1c275cb (patch) | |
tree | aa57d77d29cc5150b272cc3f6465f10262fcbaac /fs/btrfs/extent-tree.c | |
parent | f34f57a3ab4e73304d78c125682f1a53cd3975f2 (diff) |
Btrfs: Add delayed iput
iput() can trigger new transactions if we are dropping the
final reference, so calling it in btrfs_commit_transaction
may end up deadlock. This patch adds delayed iput to avoid
the issue.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4a86508ce473..fcdccfa46004 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -2880,9 +2880,9 @@ static noinline void flush_delalloc_async(struct btrfs_work *work) | |||
2880 | root = async->root; | 2880 | root = async->root; |
2881 | info = async->info; | 2881 | info = async->info; |
2882 | 2882 | ||
2883 | btrfs_start_delalloc_inodes(root); | 2883 | btrfs_start_delalloc_inodes(root, 0); |
2884 | wake_up(&info->flush_wait); | 2884 | wake_up(&info->flush_wait); |
2885 | btrfs_wait_ordered_extents(root, 0); | 2885 | btrfs_wait_ordered_extents(root, 0, 0); |
2886 | 2886 | ||
2887 | spin_lock(&info->lock); | 2887 | spin_lock(&info->lock); |
2888 | info->flushing = 0; | 2888 | info->flushing = 0; |
@@ -2956,8 +2956,8 @@ static void flush_delalloc(struct btrfs_root *root, | |||
2956 | return; | 2956 | return; |
2957 | 2957 | ||
2958 | flush: | 2958 | flush: |
2959 | btrfs_start_delalloc_inodes(root); | 2959 | btrfs_start_delalloc_inodes(root, 0); |
2960 | btrfs_wait_ordered_extents(root, 0); | 2960 | btrfs_wait_ordered_extents(root, 0, 0); |
2961 | 2961 | ||
2962 | spin_lock(&info->lock); | 2962 | spin_lock(&info->lock); |
2963 | info->flushing = 0; | 2963 | info->flushing = 0; |