Commit 49daf72e authored by HaoZhiZhang's avatar HaoZhiZhang Committed by Daniel Verkamp
Browse files

nvme: support extended LBA without protection information (#101)



If namespace is formatted with per lba metadata feature and also disable end-to-end protection
feature, host couldn't use per extended-lba metadata area.

Signed-off-by: default avatarZhihao Zhang <thomas.zzh@alibaba-inc.com>
parent 094524ba
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -96,13 +96,15 @@ int nvme_ns_identify_update(struct spdk_nvme_ns *ns)
		ns->flags |= SPDK_NVME_NS_RESERVATION_SUPPORTED;
	}

	if (nsdata->flbas.extended) {
		ns->flags |= SPDK_NVME_NS_EXTENDED_LBA_SUPPORTED;
	}

	ns->md_size = nsdata->lbaf[nsdata->flbas.format].ms;
	ns->pi_type = SPDK_NVME_FMT_NVM_PROTECTION_DISABLE;
	if (nsdata->lbaf[nsdata->flbas.format].ms && nsdata->dps.pit) {
		ns->flags |= SPDK_NVME_NS_DPS_PI_SUPPORTED;
		ns->pi_type = nsdata->dps.pit;
		if (nsdata->flbas.extended)
			ns->flags |= SPDK_NVME_NS_EXTENDED_LBA_SUPPORTED;
	}
	return rc;
}