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: Zhihao Zhang <thomas.zzh@alibaba-inc.com>
This commit is contained in:
HaoZhiZhang 2017-01-24 02:20:04 +08:00 committed by Daniel Verkamp
parent 094524ba9e
commit 49daf72e0e

View File

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