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

Commit bbe14267 authored by Miao Xie's avatar Miao Xie Committed by Josef Bacik
Browse files

Btrfs: fix unprotected extent map operation when logging file extents



We forget to protect the modified_extents list, fix it.

Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Reviewed-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 315a9850
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3526,8 +3526,10 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
		struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree;
		struct extent_map *em, *n;

		write_lock(&tree->lock);
		list_for_each_entry_safe(em, n, &tree->modified_extents, list)
			list_del_init(&em->list);
		write_unlock(&tree->lock);
	}

	if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {