Commit 3f442687 authored by Changpeng Liu's avatar Changpeng Liu
Browse files

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: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451926


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 4582e9fb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
		}
	}