git: ee96770ee375 - main - nvmecontrol: Fix mixup between pi and pil

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 19 Oct 2026 06:24:45 UTC
The branch main has been updated by imp:

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

commit ee96770ee37591d5fc9f7ee39aa1386636e8dc8d
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2026-10-19 06:19:17 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-10-19 06:22:51 +0000

    nvmecontrol: Fix mixup between pi and pil
    
    pi and pil were extracted from the incorrect place. Swap how we get/set
    there to be correct. However, since these are always 0, this is a nop.
---
 sbin/nvmecontrol/format.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sbin/nvmecontrol/format.c b/sbin/nvmecontrol/format.c
index ccf0981103c0..71e557910654 100644
--- a/sbin/nvmecontrol/format.c
+++ b/sbin/nvmecontrol/format.c
@@ -165,9 +165,9 @@ check_controller_namespace(int fd, uint32_t nsid, uint32_t sector_size,
 	ns_ms = opt.ms == NONE ?
 	    NVMEV(NVME_NS_DATA_FLBAS_EXTENDED, nsd.flbas) : opt.ms;
 	ns_pi = opt.pi == NONE ?
-	    NVMEV(NVME_NS_DATA_DPS_MD_START, nsd.dps) : opt.pi;
+	    NVMEV(NVME_NS_DATA_DPS_PIT, nsd.dps) : opt.pi;
 	ns_pil = opt.pil == NONE ?
-	    NVMEV(NVME_NS_DATA_DPS_PIT, nsd.dps) : opt.pil;
+	    NVMEV(NVME_NS_DATA_DPS_MD_START, nsd.dps) : opt.pil;
 	if (!*found) {
 		*lbaf = fmt;
 		*ms = ns_ms;
@@ -274,9 +274,9 @@ format(const struct cmd *f, int argc, char *argv[])
 		if (ms < 0)
 			ms = NVMEV(NVME_NS_DATA_FLBAS_EXTENDED, nsd.flbas);
 		if (pi < 0)
-			pi = NVMEV(NVME_NS_DATA_DPS_MD_START, nsd.dps);
+			pi = NVMEV(NVME_NS_DATA_DPS_PIT, nsd.dps);
 		if (pil < 0)
-			pil = NVMEV(NVME_NS_DATA_DPS_PIT, nsd.dps);
+			pil = NVMEV(NVME_NS_DATA_DPS_MD_START, nsd.dps);
 	} else {
 
 		/* We have no previous parameters, so default to zeroes. */