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 <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451926
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Changpeng Liu 2019-04-24 12:58:45 -04:00
parent 4582e9fb4a
commit 3f4426878a

View File

@ -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;
}
}