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.
This commit is contained in:
Warner Losh committed 2026-10-19 00:22:51 -06:00
1 parent bf3726998f
commit ee96770ee3
1 file changed
+4 -4
+4 -4
View File
@@ -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. */