The object_map_resize sanity check ensures that a resize will
not erase state for an in-use object. The check was incorrectly
including a block within the new object map range.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
size_t orig_object_map_size = object_map.size();
if (object_count < orig_object_map_size) {
- for (uint64_t i = object_count; i < orig_object_map_size; ++i) {
+ for (uint64_t i = object_count + 1; i < orig_object_map_size; ++i) {
if (object_map[i] != default_state) {
+ CLS_ERR("object map indicates object still exists: %" PRIu64, i);
return -ESTALE;
}
}