summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-10-28 09:13:25 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 22:08:10 -0500
commit93858769172c4e3678917810e9d5de360eb991cc (patch)
treef1674e2bd0b7837cc1738dd1a6261adc30c1111a /fs/btrfs/ordered-data.c
parentd788a34929a90f70b945c100cfe9efd4d49fb446 (diff)
downloadop-kernel-dev-93858769172c4e3678917810e9d5de360eb991cc.zip
op-kernel-dev-93858769172c4e3678917810e9d5de360eb991cc.tar.gz
Btrfs: take ordered root lock when removing ordered operations inode
A user reported a list corruption warning from btrfs_remove_ordered_extent, it is because we aren't taking the ordered_root_lock when we remove the inode from the ordered operations list. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index bbb1a38..8a5eff3 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -537,7 +537,9 @@ void btrfs_remove_ordered_extent(struct inode *inode,
*/
if (RB_EMPTY_ROOT(&tree->tree) &&
!mapping_tagged(inode->i_mapping, PAGECACHE_TAG_DIRTY)) {
+ spin_lock(&root->fs_info->ordered_root_lock);
list_del_init(&BTRFS_I(inode)->ordered_operations);
+ spin_unlock(&root->fs_info->ordered_root_lock);
}
if (!root->nr_ordered_extents) {
OpenPOWER on IntegriCloud