git: e6afa8ef5610 - stable/12 - Filter out LBA formats with LBA Data Size of 0.

Alexander Motin mav at FreeBSD.org
Wed Jul 21 01:55:10 UTC 2021


The branch stable/12 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=e6afa8ef56108f8f88c00cefd68e0363b32b7369

commit e6afa8ef56108f8f88c00cefd68e0363b32b7369
Author:     Alexander Motin <mav at FreeBSD.org>
AuthorDate: 2021-07-14 18:01:22 +0000
Commit:     Alexander Motin <mav at FreeBSD.org>
CommitDate: 2021-07-21 01:55:08 +0000

    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
    
    (cherry picked from commit d379886a4170fa3d95a5354612a5e2c15b104841)
---
 sbin/nvmecontrol/identify.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sbin/nvmecontrol/identify.c b/sbin/nvmecontrol/identify.c
index 86b7369883fb..6cd7ad0fdc2d 100644
--- a/sbin/nvmecontrol/identify.c
+++ b/sbin/nvmecontrol/identify.c
@@ -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) &


More information about the dev-commits-src-all mailing list