Skip to content

Commit d967c91

Browse files
naotakdave
authored andcommitted
btrfs: fix unbalanced unlock of mapping_tree_lock
The error path of btrfs_get_chunk_map() releases fs_info->mapping_tree_lock. But, it is taken and released in btrfs_find_chunk_map(). So, there is no need to do so. Fixes: 7dc66ab ("btrfs: use a dedicated data structure for chunk maps") Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent f03e274 commit d967c91

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

fs/btrfs/volumes.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3087,15 +3087,13 @@ struct btrfs_chunk_map *btrfs_get_chunk_map(struct btrfs_fs_info *fs_info,
30873087
map = btrfs_find_chunk_map(fs_info, logical, length);
30883088

30893089
if (unlikely(!map)) {
3090-
read_unlock(&fs_info->mapping_tree_lock);
30913090
btrfs_crit(fs_info,
30923091
"unable to find chunk map for logical %llu length %llu",
30933092
logical, length);
30943093
return ERR_PTR(-EINVAL);
30953094
}
30963095

30973096
if (unlikely(map->start > logical || map->start + map->chunk_len <= logical)) {
3098-
read_unlock(&fs_info->mapping_tree_lock);
30993097
btrfs_crit(fs_info,
31003098
"found a bad chunk map, wanted %llu-%llu, found %llu-%llu",
31013099
logical, logical + length, map->start,

0 commit comments

Comments
 (0)