From 3f4426878a377d694416c5a6730e4a72ef08f045 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Wed, 24 Apr 2019 12:58:45 -0400 Subject: [PATCH] nvmf: disable the protection if the backend doesn't contain valid type It's not an error if the NVMe hard drive was formatted to 512 + 8 but has no protection type, so we will also disable the protection for NVMoF target. Change-Id: I07e605cff9545f46c642f7ca783a4727a26abece Signed-off-by: Changpeng Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451926 Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- lib/nvmf/ctrlr_bdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nvmf/ctrlr_bdev.c b/lib/nvmf/ctrlr_bdev.c index 7d68e0a52..0dff288bd 100644 --- a/lib/nvmf/ctrlr_bdev.c +++ b/lib/nvmf/ctrlr_bdev.c @@ -137,8 +137,8 @@ spdk_nvmf_bdev_ctrlr_identify_ns(struct spdk_nvmf_ns *ns, struct spdk_nvme_ns_da nsdata->dps.pit = SPDK_NVME_FMT_NVM_PROTECTION_TYPE3; break; default: - SPDK_ERRLOG("Unknown DIF type: %d\n", spdk_bdev_get_dif_type(bdev)); - assert(false); + SPDK_DEBUGLOG(SPDK_LOG_NVMF, "Protection Disabled\n"); + nsdata->dps.pit = SPDK_NVME_FMT_NVM_PROTECTION_DISABLE; break; } }