The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5b812331db52783292e89192a04195031132c23
commit f5b812331db52783292e89192a04195031132c23 Author: Warner Losh <[email protected]> AuthorDate: 2025-12-05 23:17:40 +0000 Commit: Warner Losh <[email protected]> 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); }
