Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Dec 2025 23:18:21 +0000
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f5b812331db5 - main - nvme: Improve error message for invalid format value
Message-ID:  <6933683d.3cf21.3a4aef29@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by imp:

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

commit f5b812331db52783292e89192a04195031132c23
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-12-05 23:17:40 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-12-05 23:18:12 +0000

    nvme: Improve error message for invalid format value
    
    Improve the wording of the invalid namespace value. Reword the comment
    and move a line of code to the block it logically belongs to.
    
    No functional changes intended.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D51393
---
 sys/dev/nvme/nvme_ns.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c
index 4ebcc03c4f04..b6611161a2b4 100644
--- a/sys/dev/nvme/nvme_ns.c
+++ b/sys/dev/nvme/nvme_ns.c
@@ -563,16 +563,14 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id,
 		return ((ns->flags & NVME_NS_ADDED) ? 0 : ENXIO);
 	}
 
-	flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, ns->data.flbas);
-
 	/*
-	 * Note: format is a 0-based value, so > is appropriate here,
-	 *  not >=.
+	 * Check the validity of the format specified. Note: format is a 0-based
+	 * value, so > is appropriate here, not >=.
 	 */
+	flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, ns->data.flbas);
 	if (flbas_fmt > ns->data.nlbaf) {
-		nvme_printf(ctrlr,
-		    "lba format %d exceeds number supported (%d)\n",
-		    flbas_fmt, ns->data.nlbaf + 1);
+		nvme_printf(ctrlr, "nsid %d lba format %d invalid (> %d)\n",
+		    id, flbas_fmt, ns->data.nlbaf + 1);
 		return (ENXIO);
 	}
 


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6933683d.3cf21.3a4aef29>