Commit 3048a49c authored by Rafal Stefanowski's avatar Rafal Stefanowski Committed by Tomasz Zawadzki
Browse files

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: default avatarRafal 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 0cbfbbed
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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