Filter out LBA formats with LBA Data Size of 0.

According to the spec: "If the value reported is 0h, then LBA format
is not supported / used or is not currently available".

MFC after:	1 week
This commit is contained in:
Alexander Motin 2021-07-14 14:01:22 -04:00
parent 29c8295312
commit d379886a41

View File

@ -175,6 +175,8 @@ print_namespace(struct nvme_namespace_data *nsdata)
lbaf = nsdata->lbaf[i];
lbads = (lbaf >> NVME_NS_DATA_LBAF_LBADS_SHIFT) &
NVME_NS_DATA_LBAF_LBADS_MASK;
if (lbads == 0)
continue;
ms = (lbaf >> NVME_NS_DATA_LBAF_MS_SHIFT) &
NVME_NS_DATA_LBAF_MS_MASK;
rp = (lbaf >> NVME_NS_DATA_LBAF_RP_SHIFT) &