diff options
-rw-r--r-- | fs/btrfs/ctree.c | 5 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 1 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index a83cbdf1d8c4..19c0dd33b1e8 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -813,7 +813,8 @@ static noinline int generic_bin_search(struct extent_buffer *eb, | |||
813 | unmap_extent_buffer(eb, map_token, KM_USER0); | 813 | unmap_extent_buffer(eb, map_token, KM_USER0); |
814 | map_token = NULL; | 814 | map_token = NULL; |
815 | } | 815 | } |
816 | err = map_extent_buffer(eb, offset, | 816 | |
817 | err = map_private_extent_buffer(eb, offset, | ||
817 | sizeof(struct btrfs_disk_key), | 818 | sizeof(struct btrfs_disk_key), |
818 | &map_token, &kaddr, | 819 | &map_token, &kaddr, |
819 | &map_start, &map_len, KM_USER0); | 820 | &map_start, &map_len, KM_USER0); |
@@ -3585,6 +3586,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key, | |||
3585 | int level; | 3586 | int level; |
3586 | int ret = 1; | 3587 | int ret = 1; |
3587 | 3588 | ||
3589 | WARN_ON(!path->keep_locks); | ||
3588 | again: | 3590 | again: |
3589 | cur = btrfs_lock_root_node(root); | 3591 | cur = btrfs_lock_root_node(root); |
3590 | level = btrfs_header_level(cur); | 3592 | level = btrfs_header_level(cur); |
@@ -3708,6 +3710,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path, | |||
3708 | int slot; | 3710 | int slot; |
3709 | struct extent_buffer *c; | 3711 | struct extent_buffer *c; |
3710 | 3712 | ||
3713 | WARN_ON(!path->keep_locks); | ||
3711 | while(level < BTRFS_MAX_LEVEL) { | 3714 | while(level < BTRFS_MAX_LEVEL) { |
3712 | if (!path->nodes[level]) | 3715 | if (!path->nodes[level]) |
3713 | return 1; | 3716 | return 1; |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 7449ecf32c50..607f5ff2791c 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -3471,6 +3471,7 @@ int map_extent_buffer(struct extent_buffer *eb, unsigned long start, | |||
3471 | unmap_extent_buffer(eb, eb->map_token, km); | 3471 | unmap_extent_buffer(eb, eb->map_token, km); |
3472 | eb->map_token = NULL; | 3472 | eb->map_token = NULL; |
3473 | save = 1; | 3473 | save = 1; |
3474 | WARN_ON(!mutex_is_locked(&eb->mutex)); | ||
3474 | } | 3475 | } |
3475 | err = map_private_extent_buffer(eb, start, min_len, token, map, | 3476 | err = map_private_extent_buffer(eb, start, min_len, token, map, |
3476 | map_start, map_len, km); | 3477 | map_start, map_len, km); |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index a79b3cc09e94..825364fae690 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2594,12 +2594,15 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | |||
2594 | stripe_nr = stripe_nr * map->num_stripes + i; | 2594 | stripe_nr = stripe_nr * map->num_stripes + i; |
2595 | } | 2595 | } |
2596 | bytenr = chunk_start + stripe_nr * map->stripe_len; | 2596 | bytenr = chunk_start + stripe_nr * map->stripe_len; |
2597 | WARN_ON(nr >= map->num_stripes); | ||
2597 | for (j = 0; j < nr; j++) { | 2598 | for (j = 0; j < nr; j++) { |
2598 | if (buf[j] == bytenr) | 2599 | if (buf[j] == bytenr) |
2599 | break; | 2600 | break; |
2600 | } | 2601 | } |
2601 | if (j == nr) | 2602 | if (j == nr) { |
2603 | WARN_ON(nr >= map->num_stripes); | ||
2602 | buf[nr++] = bytenr; | 2604 | buf[nr++] = bytenr; |
2605 | } | ||
2603 | } | 2606 | } |
2604 | 2607 | ||
2605 | for (i = 0; i > nr; i++) { | 2608 | for (i = 0; i > nr; i++) { |