diff options
author | David Sterba <dsterba@suse.com> | 2019-03-27 16:19:55 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 14:59:00 +0200 |
commit | d23ea3fa7dcb0d4a2c405de0879bc4ddcf521d7d (patch) | |
tree | 7c2137a3d680ffabd22c8b09f365e3c1da20ceec /fs/btrfs/extent_map.c | |
parent | 982f1f5d161735efb85f85cd9c5fb4d61ccfc0aa (diff) | |
download | lwn-d23ea3fa7dcb0d4a2c405de0879bc4ddcf521d7d.tar.gz lwn-d23ea3fa7dcb0d4a2c405de0879bc4ddcf521d7d.zip |
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 <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r-- | fs/btrfs/extent_map.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |