bdev/ocf: Fix initial force flag

Force is not supported in loading-existing-cache scenario,
so it is set to true only when initializing cache as new.
There is already patch in OCF waiting to be merged, that
addresses this problem by creating completely separate
pipelines to load and attach scenarios, thus ignoring the
force flag when cache is being loaded.

Fixes #1708

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I72269e2eacab6dffbecb725592af555e2f3702de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5595
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Rafal Stefanowski 2020-12-13 13:07:16 +01:00 committed by Tomasz Zawadzki
parent 0cbfbbed2d
commit 3048a49c29

View File

@ -1145,7 +1145,6 @@ init_vbdev_config(struct vbdev_ocf *vbdev)
cfg->cache.backfill.max_queue_size = 65536;
cfg->cache.backfill.queue_unblock_size = 60000;
cfg->device.force = true;
cfg->device.perform_test = false;
cfg->device.discard_on_start = false;
@ -1159,6 +1158,10 @@ init_vbdev_config(struct vbdev_ocf *vbdev)
* otherwise OCF will interpret this core as new
* instead of the inactive one */
vbdev->cfg.core.try_add = true;
} else {
/* When cache is initialized as new, set force flag to true,
* to ignore warnings about existing metadata */
cfg->device.force = true;
}
/* Serialize bdev names in OCF UUID to interpret on future loads