Skip to content

Commit

Permalink
Btrfs: don't invoke btrfs_invalidate_inodes() in the spin lock context
Browse files Browse the repository at this point in the history
btrfs_invalidate_inodes() may sleep, so we should not invoke it in the
spin lock context. Fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Miao Xie authored and Josef Bacik committed May 18, 2013
1 parent 314297c commit b216cbf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3658,8 +3658,11 @@ static void btrfs_destroy_ordered_operations(struct btrfs_transaction *t,
ordered_operations);

list_del_init(&btrfs_inode->ordered_operations);
spin_unlock(&root->fs_info->ordered_extent_lock);

btrfs_invalidate_inodes(btrfs_inode->root);

spin_lock(&root->fs_info->ordered_extent_lock);
}

spin_unlock(&root->fs_info->ordered_extent_lock);
Expand Down Expand Up @@ -3781,8 +3784,11 @@ static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)
list_del_init(&btrfs_inode->delalloc_inodes);
clear_bit(BTRFS_INODE_IN_DELALLOC_LIST,
&btrfs_inode->runtime_flags);
spin_unlock(&root->fs_info->delalloc_lock);

btrfs_invalidate_inodes(btrfs_inode->root);

spin_lock(&root->fs_info->delalloc_lock);
}

spin_unlock(&root->fs_info->delalloc_lock);
Expand Down

0 comments on commit b216cbf

Please sign in to comment.