lib/ftl: check non-volatile cache's DIF type

Check the type of DIF used by the bdev specified as the non-volatile
write cache. If it's anything other than SPDK_DIF_DISABLE, fail the
initialization, as we don't support any other type yet.

Change-Id: Ie8bc1729558e055989d7925bc55f6307ee738f0e
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458096
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
This commit is contained in:
Konrad Sztyber 2019-06-12 14:48:02 +02:00 committed by Ben Walker
parent 77ddc70e1c
commit 2c96745563

View File

@ -524,6 +524,12 @@ ftl_dev_init_nv_cache(struct spdk_ftl_dev *dev, struct spdk_bdev_desc *bdev_desc
return -1;
}
if (spdk_bdev_get_dif_type(bdev) != SPDK_DIF_DISABLE) {
SPDK_ERRLOG("Unsupported DIF type used by bdev %s\n",
spdk_bdev_get_name(bdev));
return -1;
}
/* The cache needs to be capable of storing at least two full bands. This requirement comes
* from the fact that cache works as a protection against power loss, so before the data
* inside the cache can be overwritten, the band it's stored on has to be closed. Plus one