Skip to content

Commit

Permalink
nvmet: fix byte swap in nvmet_parse_io_cmd
Browse files Browse the repository at this point in the history
We need to do arithmetics after byte swapping, not before.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
  • Loading branch information
Christoph Hellwig authored and sagigrimberg committed Apr 2, 2017
1 parent 78ce3da commit 793c7ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/target/io-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,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 + 1) *
req->data_len = (le32_to_cpu(cmd->dsm.nr) + 1) *
sizeof(struct nvme_dsm_range);
return 0;
case nvme_cmd_write_zeroes:
Expand Down

0 comments on commit 793c7ed

Please sign in to comment.