summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorAlexander Solganik <sashas@lightbitslabs.com>2016-09-22 00:12:38 +0300
committerSagi Grimberg <sagi@grimberg.me>2016-09-24 01:37:38 +0300
commit2e5d0baa04845dc3a3d7dfa33d7663de270bb146 (patch)
tree62be77922deaf9006113615ab7bb162cad3ec4e5 /drivers/nvme
parent9b349b080ca9777f6dab3da06d7fa4577f7d4c29 (diff)
downloadlinux-2e5d0baa04845dc3a3d7dfa33d7663de270bb146.tar.xz
nvmet: Make dsm number of ranges zero based
This caused the nvmet request data length to be incorrect. Signed-off-by: Alexander Solganik <sashas@lightbitslabs.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/target/io-cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/io-cmd.c b/drivers/nvme/target/io-cmd.c
index 4132b6b98182..4a96c2049b7b 100644
--- a/drivers/nvme/target/io-cmd.c
+++ b/drivers/nvme/target/io-cmd.c
@@ -206,7 +206,7 @@ int nvmet_parse_io_cmd(struct nvmet_req *req)
return 0;
case nvme_cmd_dsm:
req->execute = nvmet_execute_dsm;
- req->data_len = le32_to_cpu(cmd->dsm.nr) *
+ req->data_len = le32_to_cpu(cmd->dsm.nr + 1) *
sizeof(struct nvme_dsm_range);
return 0;
default: