Read superblock sections from cache volume during activate
Because of metadata flapping it is much more complicated to capture those sections in flight in standby mode, so we read them directly from the cache volume during the activate. Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
98cb9bff70
commit
df9a9f2722
@ -18,7 +18,7 @@ struct pio_ctx {
|
||||
uint64_t first_entry;
|
||||
uint64_t begin;
|
||||
uint64_t end;
|
||||
} segments[5];
|
||||
} segments[2];
|
||||
};
|
||||
|
||||
#define OUT_OF_RANGE -1
|
||||
@ -181,9 +181,6 @@ int ocf_pio_concurrency_init(struct ocf_alock **self, ocf_cache_t cache)
|
||||
uint32_t pages_to_alloc = 0;
|
||||
enum ocf_metadata_segment_id update_segments[] = {
|
||||
metadata_segment_sb_config,
|
||||
metadata_segment_part_config,
|
||||
metadata_segment_core_config,
|
||||
metadata_segment_core_uuid,
|
||||
metadata_segment_collision,
|
||||
};
|
||||
int i;
|
||||
|
@ -234,9 +234,6 @@ static int passive_io_resume(struct ocf_request *req)
|
||||
ocf_cache_line_t cache_etries = ocf_metadata_collision_table_entries(cache);
|
||||
enum ocf_metadata_segment_id update_segments[] = {
|
||||
metadata_segment_sb_config,
|
||||
metadata_segment_part_config,
|
||||
metadata_segment_core_config,
|
||||
metadata_segment_core_uuid,
|
||||
metadata_segment_collision,
|
||||
};
|
||||
int i;
|
||||
|
@ -2216,19 +2216,17 @@ static void _ocf_mngt_activate_set_cache_device(ocf_pipeline_t pipeline,
|
||||
ocf_pipeline_next(pipeline);
|
||||
}
|
||||
|
||||
static void _ocf_mngt_activate_check_superblock_complete(void *priv, int error)
|
||||
static void _ocf_mngt_activate_check_superblock(ocf_pipeline_t pipeline,
|
||||
void *priv, ocf_pipeline_arg_t arg)
|
||||
{
|
||||
struct ocf_cache_attach_context *context = priv;
|
||||
ocf_cache_t cache = context->cache;
|
||||
int result;
|
||||
|
||||
if (error)
|
||||
OCF_PL_FINISH_RET(context->pipeline, error);
|
||||
|
||||
result = ocf_metadata_validate_superblock(cache->owner,
|
||||
cache->conf_meta);
|
||||
if (result)
|
||||
OCF_PL_FINISH_RET(context->pipeline, result);
|
||||
OCF_PL_FINISH_RET(pipeline, result);
|
||||
|
||||
if (cache->conf_meta->metadata_layout != cache->metadata.layout) {
|
||||
ocf_cache_log(cache, log_err, "Failed to activate standby instance: "
|
||||
@ -2244,17 +2242,7 @@ static void _ocf_mngt_activate_check_superblock_complete(void *priv, int error)
|
||||
-OCF_ERR_CACHE_LINE_SIZE_MISMATCH);
|
||||
}
|
||||
|
||||
ocf_pipeline_next(context->pipeline);
|
||||
}
|
||||
|
||||
static void _ocf_mngt_activate_check_superblock(ocf_pipeline_t pipeline,
|
||||
void *priv, ocf_pipeline_arg_t arg)
|
||||
{
|
||||
struct ocf_cache_attach_context *context = priv;
|
||||
ocf_cache_t cache = context->cache;
|
||||
|
||||
ocf_metadata_sb_crc_recovery(cache,
|
||||
_ocf_mngt_activate_check_superblock_complete, context);
|
||||
ocf_pipeline_next(pipeline);
|
||||
}
|
||||
|
||||
static void _ocf_mngt_activate_compare_superblock_end(
|
||||
@ -2378,8 +2366,9 @@ struct ocf_pipeline_properties _ocf_mngt_cache_activate_pipeline_properties = {
|
||||
.steps = {
|
||||
OCF_PL_STEP(_ocf_mngt_copy_uuid_data),
|
||||
OCF_PL_STEP(_ocf_mngt_activate_set_cache_device),
|
||||
OCF_PL_STEP(_ocf_mngt_activate_check_superblock),
|
||||
OCF_PL_STEP(_ocf_mngt_activate_compare_superblock),
|
||||
OCF_PL_STEP(_ocf_mngt_load_superblock),
|
||||
OCF_PL_STEP(_ocf_mngt_activate_check_superblock),
|
||||
OCF_PL_STEP(_ocf_mngt_activate_init_properties),
|
||||
OCF_PL_STEP(_ocf_mngt_test_volume),
|
||||
OCF_PL_STEP(_ocf_mngt_init_promotion),
|
||||
|
Loading…
Reference in New Issue
Block a user