Merge pull request #595 from arutk/passive_fix

fix cacheline reset in passive metadata update
This commit is contained in:
Robert Baldyga 2021-11-30 15:00:50 +01:00 committed by GitHub
commit 706bc8407b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,8 +32,12 @@ static inline void _reset_cline(ocf_cache_t cache, ocf_cache_line_t cline)
ocf_lru_clean_cline(cache, &cache->user_parts[PARTITION_DEFAULT].part,
cline);
metadata_init_status_bits(cache, cline);
ocf_lru_rm_cline(cache, cline);
ocf_metadata_set_partition_id(cache, cline, PARTITION_FREELIST);
ocf_metadata_set_core_info(cache, cline, OCF_CORE_MAX, ULLONG_MAX);
}
static inline void remove_from_freelist(ocf_cache_t cache,
@ -204,6 +208,9 @@ static void cleanup_old_mapping(ocf_cache_t cache, ocf_cache_line_t start,
if (!core)
continue;
ENV_BUG_ON(ocf_metadata_get_partition_id(cache, cline) !=
PARTITION_DEFAULT);
_dec_core_stats(core);
ocf_hb_cline_prot_lock_wr(&cache->metadata.lock, lock_idx, core_id,