Bug 2208399 - nvme-cli 9.2 Changes in Version 2.2.1 added a NVME_SANITIZE_SSTAT_STATUS_MASK mask and it causes possibly incorrect values to be displayed
Summary: nvme-cli 9.2 Changes in Version 2.2.1 added a NVME_SANITIZE_SSTAT_STATUS_MASK...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: nvme-cli
Version: 9.2
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: 9.3
Assignee: Maurizio Lombardi
QA Contact: Zhang Yi
URL:
Whiteboard:
Depends On:
Blocks: 1798275 1846002 2186840 2186842 2186843 2214603
TreeView+ depends on / blocked
 
Reported: 2023-05-18 21:35 UTC by loberman
Modified: 2023-07-28 12:17 UTC (History)
8 users (show)

Fixed In Version: nvme-cli-2.4-6.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2214603 (view as bug list)
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-157685 0 None None None 2023-05-18 21:36:51 UTC

Description loberman 2023-05-18 21:35:57 UTC
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


Note You need to log in before you can comment on or make changes to this bug.