Merge pull request #7344 from songbaisen/song8

crush: add safety assert

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-01-31 10:02:13 -05:00
commit ace46dadb4

View File

@ -176,7 +176,7 @@ int crush_add_bucket(struct crush_map *map,
int crush_remove_bucket(struct crush_map *map, struct crush_bucket *bucket)
{
int pos = -1 - bucket->id;
assert(pos < map->max_buckets);
map->buckets[pos] = NULL;
crush_destroy_bucket(bucket);
return 0;