diff options
author | Daniel Verkamp <daniel.verkamp@intel.com> | 2016-12-09 20:59:46 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2016-12-21 11:34:27 +0100 |
commit | 6c73f949300f17851f53fa80c9d1611ccd6909d3 (patch) | |
tree | 1d29090a3a56f6b9557886953c348e675bb2afd6 /drivers/nvme/target/admin-cmd.c | |
parent | nvme/fc: simplify error handling of nvme_fc_create_hw_io_queues (diff) | |
download | linux-6c73f949300f17851f53fa80c9d1611ccd6909d3.tar.xz linux-6c73f949300f17851f53fa80c9d1611ccd6909d3.zip |
nvmet: fix KATO offset in Set Features
The Set Features implementation for Keep Alive Timer was using the wrong
structure when retrieving the KATO value; it was treating the Set
Features command as a Property Set command.
The NVMe spec defines the Keep Alive Timer feature as having one input
in CDW11 (4 bytes at offset 44 in the command) whereas the code was
reading 8 bytes at offset 48.
Since the Linux NVMe over Fabrics host never sets this feature, this
code has presumably never been tested.
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to '')
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index ec1ad2aa0a4c..95ae52390478 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -382,7 +382,6 @@ static void nvmet_execute_set_features(struct nvmet_req *req) { struct nvmet_subsys *subsys = req->sq->ctrl->subsys; u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10[0]); - u64 val; u32 val32; u16 status = 0; @@ -392,8 +391,7 @@ static void nvmet_execute_set_features(struct nvmet_req *req) (subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16)); break; case NVME_FEAT_KATO: - val = le64_to_cpu(req->cmd->prop_set.value); - val32 = val & 0xffff; + val32 = le32_to_cpu(req->cmd->common.cdw10[1]); req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); nvmet_set_result(req, req->sq->ctrl->kato); break; |