unmap_extent_buffer(eb, map_token, KM_USER0);
map_token = NULL;
}
- err = map_extent_buffer(eb, offset,
+
+ err = map_private_extent_buffer(eb, offset,
sizeof(struct btrfs_disk_key),
&map_token, &kaddr,
&map_start, &map_len, KM_USER0);
int level;
int ret = 1;
+ WARN_ON(!path->keep_locks);
again:
cur = btrfs_lock_root_node(root);
level = btrfs_header_level(cur);
int slot;
struct extent_buffer *c;
+ WARN_ON(!path->keep_locks);
while(level < BTRFS_MAX_LEVEL) {
if (!path->nodes[level])
return 1;
unmap_extent_buffer(eb, eb->map_token, km);
eb->map_token = NULL;
save = 1;
+ WARN_ON(!mutex_is_locked(&eb->mutex));
}
err = map_private_extent_buffer(eb, start, min_len, token, map,
map_start, map_len, km);
stripe_nr = stripe_nr * map->num_stripes + i;
}
bytenr = chunk_start + stripe_nr * map->stripe_len;
+ WARN_ON(nr >= map->num_stripes);
for (j = 0; j < nr; j++) {
if (buf[j] == bytenr)
break;
}
- if (j == nr)
+ if (j == nr) {
+ WARN_ON(nr >= map->num_stripes);
buf[nr++] = bytenr;
+ }
}
for (i = 0; i > nr; i++) {