From: David Sterba Date: Wed, 27 Mar 2019 15:19:55 +0000 (+0100) Subject: btrfs: assert extent map tree lock in add_extent_mapping X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d23ea3fa7dcb0d4a2c405de0879bc4ddcf521d7d;p=openwrt%2Fstaging%2Fblogic.git btrfs: assert extent map tree lock in add_extent_mapping As add_extent_mapping is called from several functions, let's add the lock annotation. The tree is going to be modified so it must be the exclusive lock. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 9558d79faf1e..9d30acca55e1 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -384,6 +384,8 @@ int add_extent_mapping(struct extent_map_tree *tree, { int ret = 0; + lockdep_assert_held_write(&tree->lock); + ret = tree_insert(&tree->map, em); if (ret) goto out;