Description of problem:
Customer upgraded nvme-cli to 2.2.1 and now is not happy with the output of the nvme sanitize-log command
Version-Release number of selected component (if applicable):
nvme-cli 2.2.1
How reproducible:
Happens with nvme-cli 2.2.1
Steps to Reproduce:
1.Update to nvme-cli 2.2.1
then
2.Run [root@os10 ~]# nvme sanitize /dev/nvme0n5 -a 2 -u.
Actual results:
[root@os10 ~]# nvme sanitize-log /dev/nvme0n5.
Sanitize Progress (SPROG) : 65535
Sanitize Status (SSTAT) : 0x1 <--- different due to changes
Expected results:
[root@os10 ~]# nvme sanitize /dev/nvme0n5 -a 2 -u.
Sanitize Progress (SPROG) : 65535
Sanitize Status (SSTAT) : 0x101 <--- EXPECTED OUTPUT
Additional info:
Looked at the source code to see what has changed
New nvme-cli has a mask now of NVME_SANITIZE_SSTAT_STATUS_MASK & to le16_to_cpu(sanitize->sstat)
printf("Sanitize Status (SSTAT) : %#x\n",
le16_to_cpu(sanitize->sstat) & NVME_SANITIZE_SSTAT_STATUS_MASK);
diff is here
@@ -6432,7 +6497,7 @@ void nvme_show_sanitize_log(struct nvme_
printf("\n");
printf("Sanitize Status (SSTAT) : %#x\n",
- le16_to_cpu(sanitize->sstat));
+ le16_to_cpu(sanitize->sstat) & NVME_SANITIZE_SSTAT_STATUS_MASK);
if (human)
nvme_show_sanitize_log_sstat(le16_to_cpu(sanitize->sstat));
NVME_SANITIZE_SSTAT_STATUS_MASK
Mask to get the status value of the most recent sanitize operation.
This seems to be why the output has changed.
The question becomes, which output is correct
Description of problem: Customer upgraded nvme-cli to 2.2.1 and now is not happy with the output of the nvme sanitize-log command Version-Release number of selected component (if applicable): nvme-cli 2.2.1 How reproducible: Happens with nvme-cli 2.2.1 Steps to Reproduce: 1.Update to nvme-cli 2.2.1 then 2.Run [root@os10 ~]# nvme sanitize /dev/nvme0n5 -a 2 -u. Actual results: [root@os10 ~]# nvme sanitize-log /dev/nvme0n5. Sanitize Progress (SPROG) : 65535 Sanitize Status (SSTAT) : 0x1 <--- different due to changes Expected results: [root@os10 ~]# nvme sanitize /dev/nvme0n5 -a 2 -u. Sanitize Progress (SPROG) : 65535 Sanitize Status (SSTAT) : 0x101 <--- EXPECTED OUTPUT Additional info: Looked at the source code to see what has changed New nvme-cli has a mask now of NVME_SANITIZE_SSTAT_STATUS_MASK & to le16_to_cpu(sanitize->sstat) printf("Sanitize Status (SSTAT) : %#x\n", le16_to_cpu(sanitize->sstat) & NVME_SANITIZE_SSTAT_STATUS_MASK); diff is here @@ -6432,7 +6497,7 @@ void nvme_show_sanitize_log(struct nvme_ printf("\n"); printf("Sanitize Status (SSTAT) : %#x\n", - le16_to_cpu(sanitize->sstat)); + le16_to_cpu(sanitize->sstat) & NVME_SANITIZE_SSTAT_STATUS_MASK); if (human) nvme_show_sanitize_log_sstat(le16_to_cpu(sanitize->sstat)); NVME_SANITIZE_SSTAT_STATUS_MASK Mask to get the status value of the most recent sanitize operation. This seems to be why the output has changed. The question becomes, which output is correct