From: Yongseok Oh Date: Tue, 6 Sep 2016 02:55:55 +0000 (+0900) Subject: fix inappropriate size of resv10 [] array field in the nvme_reservation_status based... X-Git-Tag: v1.0~66 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c35c76e56a194a69f8134eab1995693ae01c2ca6;p=users%2Fsagi%2Fnvme-cli.git fix inappropriate size of resv10 [] array field in the nvme_reservation_status based NVMe 1.21 spec. Add cdw10 field to convey Number of Dwords (NUMD) for the Reservation Report command --- diff --git a/nvme-ioctl.c b/nvme-ioctl.c index 8698e1d7..188f0805 100644 --- a/nvme-ioctl.c +++ b/nvme-ioctl.c @@ -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 636053d9..162509f5 100644 --- 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 5bb2a888..e6028185 100644 --- 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;