Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93858769 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason
Browse files

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: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent d788a349
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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) {