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>
This commit is contained in:
Christoph Hellwig 2017-03-31 17:00:07 +02:00 committed by Sagi Grimberg
parent 5ac5fcc6c7
commit 78ce3daa7d
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ static void nvmet_execute_write_zeroes(struct nvmet_req *req)
sector = le64_to_cpu(write_zeroes->slba) << sector = le64_to_cpu(write_zeroes->slba) <<
(req->ns->blksize_shift - 9); (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; (req->ns->blksize_shift - 9)) + 1;
if (__blkdev_issue_zeroout(req->ns->bdev, sector, nr_sector, if (__blkdev_issue_zeroout(req->ns->bdev, sector, nr_sector,