diff options
author | Christoph Hellwig <hch@lst.de> | 2017-03-31 17:00:05 +0200 |
---|---|---|
committer | Sagi Grimberg <sagi@grimberg.me> | 2017-04-02 09:24:15 +0200 |
commit | f1dd03a84dbf3e5ca91295a3d04c882b8bd86251 (patch) | |
tree | 3437d739d83b0dabb57779d109ca3b24498ebb34 /drivers/nvme | |
parent | nvme: Correct NVMF enum values to match NVMe-oF rev 1.0 (diff) | |
download | linux-f1dd03a84dbf3e5ca91295a3d04c882b8bd86251.tar.xz linux-f1dd03a84dbf3e5ca91295a3d04c882b8bd86251.zip |
nvme: add missing byte swap in nvme_setup_discard
Fixes: b35ba01e ("nvme: support ranged discard requests")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 9b3b57fef446..9583a5f58a1d 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -270,7 +270,7 @@ static inline int nvme_setup_discard(struct nvme_ns *ns, struct request *req, memset(cmnd, 0, sizeof(*cmnd)); cmnd->dsm.opcode = nvme_cmd_dsm; cmnd->dsm.nsid = cpu_to_le32(ns->ns_id); - cmnd->dsm.nr = segments - 1; + cmnd->dsm.nr = cpu_to_le32(segments - 1); cmnd->dsm.attributes = cpu_to_le32(NVME_DSMGMT_AD); req->special_vec.bv_page = virt_to_page(range); |