Always modify valid_core_map together with core_count
.. to assure that superblock config state on drive is consistent Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
9ebb0de878
commit
09b73461b4
@ -134,6 +134,7 @@ static void _ocf_mngt_cache_add_core_handle_error(
|
|||||||
if (context->flags.counters_allocated) {
|
if (context->flags.counters_allocated) {
|
||||||
env_bit_clear(core_id,
|
env_bit_clear(core_id,
|
||||||
cache->conf_meta->valid_core_bitmap);
|
cache->conf_meta->valid_core_bitmap);
|
||||||
|
cache->conf_meta->core_count--;
|
||||||
core->conf_meta->valid = false;
|
core->conf_meta->valid = false;
|
||||||
core->added = false;
|
core->added = false;
|
||||||
core->opened = false;
|
core->opened = false;
|
||||||
@ -356,9 +357,6 @@ static void _ocf_mngt_cache_add_core_flush_sb_complete(void *priv, int error)
|
|||||||
if (error)
|
if (error)
|
||||||
OCF_PL_FINISH_RET(context->pipeline, -OCF_ERR_WRITE_CACHE);
|
OCF_PL_FINISH_RET(context->pipeline, -OCF_ERR_WRITE_CACHE);
|
||||||
|
|
||||||
/* Increase value of added cores */
|
|
||||||
context->cache->conf_meta->core_count++;
|
|
||||||
|
|
||||||
ocf_pipeline_next(context->pipeline);
|
ocf_pipeline_next(context->pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,6 +461,8 @@ static void ocf_mngt_cache_add_core_insert(ocf_pipeline_t pipeline,
|
|||||||
|
|
||||||
/* In metadata mark data this core was added into cache */
|
/* In metadata mark data this core was added into cache */
|
||||||
env_bit_set(core_id, cache->conf_meta->valid_core_bitmap);
|
env_bit_set(core_id, cache->conf_meta->valid_core_bitmap);
|
||||||
|
context->cache->conf_meta->core_count++;
|
||||||
|
|
||||||
core->conf_meta->valid = true;
|
core->conf_meta->valid = true;
|
||||||
core->added = true;
|
core->added = true;
|
||||||
core->opened = true;
|
core->opened = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user