diff options
author | Christoph Hellwig <hch@lst.de> | 2017-03-31 17:00:07 +0200 |
---|---|---|
committer | Sagi Grimberg <sagi@grimberg.me> | 2017-04-02 09:24:15 +0200 |
commit | 78ce3daa7d703028c00eff2e03ad22efd116e549 (patch) | |
tree | 6cad25c182d8a69eb6eb74b9e568eba9f40aa62d /drivers/nvme/target | |
parent | nvmet: add missing byte swap in nvmet_get_smart_log (diff) | |
download | linux-78ce3daa7d703028c00eff2e03ad22efd116e549.tar.xz linux-78ce3daa7d703028c00eff2e03ad22efd116e549.zip |
nvmet: fix byte swap in nvmet_execute_write_zeroes
The length field in the Write Zeroes command is a 16-bit field.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme/target')
-rw-r--r-- | drivers/nvme/target/io-cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/io-cmd.c b/drivers/nvme/target/io-cmd.c index 4195115c7e54..e37acd77b5fe 100644 --- a/drivers/nvme/target/io-cmd.c +++ b/drivers/nvme/target/io-cmd.c @@ -180,7 +180,7 @@ static void nvmet_execute_write_zeroes(struct nvmet_req *req) sector = le64_to_cpu(write_zeroes->slba) << (req->ns->blksize_shift - 9); - nr_sector = (((sector_t)le32_to_cpu(write_zeroes->length)) << + nr_sector = (((sector_t)le16_to_cpu(write_zeroes->length)) << (req->ns->blksize_shift - 9)) + 1; if (__blkdev_issue_zeroout(req->ns->bdev, sector, nr_sector, |