From: Josef Bacik Date: Mon, 28 Oct 2013 13:13:25 +0000 (-0400) Subject: Btrfs: take ordered root lock when removing ordered operations inode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=93858769172c4e3678917810e9d5de360eb991cc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index bbb1a3864686..8a5eff366596 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) {