Fix removing cores from cleaning policy

After detaching a core if user wanted to remove inactive cores the
cleaning policy data would not be initialized and would bug-out on next
core add.

This check was incorrect, as cleaning policy core metadata lifetime is
not bound to core volume being open or not.

Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
Jan Musial 2021-04-14 14:31:51 +02:00
parent 7dcf90ef6a
commit 51455330ad

View File

@ -41,11 +41,9 @@ void cache_mngt_core_remove_from_cleaning_pol(ocf_core_t core)
ocf_metadata_start_exclusive_access(&cache->metadata.lock); ocf_metadata_start_exclusive_access(&cache->metadata.lock);
clean_pol_type = cache->conf_meta->cleaning_policy_type; clean_pol_type = cache->conf_meta->cleaning_policy_type;
if (cache->core[core_id].opened) { if (cleaning_policy_ops[clean_pol_type].remove_core) {
if (cleaning_policy_ops[clean_pol_type].remove_core) { cleaning_policy_ops[clean_pol_type].
cleaning_policy_ops[clean_pol_type]. remove_core(cache, core_id);
remove_core(cache, core_id);
}
} }
ocf_metadata_end_exclusive_access(&cache->metadata.lock); ocf_metadata_end_exclusive_access(&cache->metadata.lock);