]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
fix inappropriate size of resv10 [] array field in the nvme_reservation_status based...
authorYongseok Oh <yongseok.oh@sk.com>
Tue, 6 Sep 2016 02:55:55 +0000 (11:55 +0900)
committerKeith Busch <keith.busch@intel.com>
Tue, 6 Sep 2016 22:18:03 +0000 (16:18 -0600)
Add cdw10 field to convey Number of Dwords (NUMD) for the Reservation Report command

nvme-ioctl.c
nvme.c
nvme.h

index 8698e1d7a375fc92921f6e40b1deb47c39c8b5cd..188f0805e398b7ed2cc41aea4bebd67af8401454 100644 (file)
@@ -296,6 +296,7 @@ int nvme_resv_report(int fd, __u32 nsid, __u32 numd, void *data)
        struct nvme_passthru_cmd cmd = {
                .opcode         = nvme_cmd_resv_report,
                .nsid           = nsid,
+               .cdw10          = numd,
                .addr           = (__u64)(uintptr_t) data,
                .data_len       = numd << 2,
        };
diff --git a/nvme.c b/nvme.c
index 636053d9c1c698f8a262985ef118523bc8f298a3..162509f5ef0b1d93bee7859e00ba58555a5fd3bc 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -2074,7 +2074,7 @@ static int resv_release(int argc, char **argv, struct command *cmd, struct plugi
        else if (err != 0)
                fprintf(stderr, "NVME IO command error:%04x\n", err);
        else
-               printf("NVME Reservation Register success\n");
+               printf("NVME Reservation Release success\n");
        return 0;
 }
 
diff --git a/nvme.h b/nvme.h
index 5bb2a888918acc11c29f28e5e1d45772b6c2d265..e602818552a6d6e1844d9357fe2b4610699a97b7 100644 (file)
--- a/nvme.h
+++ b/nvme.h
@@ -351,7 +351,7 @@ struct nvme_reservation_status {
        __u8    regctl[2];
        __u8    resv5[2];
        __u8    ptpls;
-       __u8    resv10[13];
+       __u8    resv10[14];
        struct {
                __le16  cntlid;
                __u8    rcsts;