]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
ioctl: correct feature IDs in Get/Set Features commands
authorCaleb Sander <csander@purestorage.com>
Fri, 8 Sep 2023 18:21:04 +0000 (12:21 -0600)
committerDaniel Wagner <wagi@monom.org>
Wed, 20 Sep 2023 08:33:57 +0000 (10:33 +0200)
Several nvme_{g,s}et_features_*() functions use the wrong feature ID.
Correct them so the intended feature is requested.

Signed-off-by: Caleb Sander <csander@purestorage.com>
src/nvme/ioctl.c

index ec0ac6b61db27abe2a8f3c6b26afe82e60672ba2..91429f473a02a3b63045d0ec3c89c2970e21bf48 100644 (file)
@@ -678,6 +678,7 @@ int nvme_set_features_timestamp(int fd, bool save, __u64 timestamp)
        struct nvme_set_features_args args = {
                .args_size = sizeof(args),
                .fd = fd,
+               .fid = NVME_FEAT_FID_TIMESTAMP,
                .nsid = NVME_NSID_NONE,
                .cdw11 = 0,
                .cdw12 = 0,
@@ -998,7 +999,7 @@ int nvme_get_features_irq_config(int fd, enum nvme_get_features_sel sel,
        struct nvme_get_features_args args = {
                .args_size = sizeof(args),
                .fd = fd,
-               .fid = NVME_FEAT_FID_LBA_RANGE,
+               .fid = NVME_FEAT_FID_IRQ_CONFIG,
                .nsid = NVME_NSID_NONE,
                .sel = sel,
                .cdw11 = iv,
@@ -1031,7 +1032,7 @@ int nvme_get_features_auto_pst(int fd, enum nvme_get_features_sel sel,
        struct nvme_get_features_args args = {
                .args_size = sizeof(args),
                .fd = fd,
-               .fid = NVME_FEAT_FID_LBA_RANGE,
+               .fid = NVME_FEAT_FID_AUTO_PST,
                .nsid = NVME_NSID_NONE,
                .sel = sel,
                .cdw11 = 0,