aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorJon Derrick <jonathan.derrick@intel.com>2017-04-24 18:02:43 -0600
committerChristoph Hellwig <hch@lst.de>2017-04-25 20:01:00 +0200
commit7fad1fd46ccf3ee283052e948cf91edd0cd9b1c7 (patch)
tree50c5ecde574c0103042b1fb26297b7e667d82a67 /drivers/nvme
parentnvme-fc: avoid memory corruption caused by calling nvmf_free_options() twice (diff)
downloadlinux-dev-7fad1fd46ccf3ee283052e948cf91edd0cd9b1c7.tar.xz
linux-dev-7fad1fd46ccf3ee283052e948cf91edd0cd9b1c7.zip
nvme-scsi: Consider LBA format in IO splitting calculation
The current command submission code uses a sector-based value when considering the maximum number of blocks per command. With a 4k-formatted namespace and a command exceeding max hardware limits, this calculation doesn't split IOs which should be split and fails in the nvme layer. This patch fixes that calculation and enables IO splitting in these circumstances. Signed-off-by: Jon Derrick <jonathan.derrick@intel.com> Reviewed-by: Jens Axboe <axboe@fb.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c
index f49ae2758bb7..988da610d6aa 100644
--- a/drivers/nvme/host/scsi.c
+++ b/drivers/nvme/host/scsi.c
@@ -1609,7 +1609,7 @@ static int nvme_trans_do_nvme_io(struct nvme_ns *ns, struct sg_io_hdr *hdr,
struct nvme_command c;
u8 opcode = (is_write ? nvme_cmd_write : nvme_cmd_read);
u16 control;
- u32 max_blocks = queue_max_hw_sectors(ns->queue);
+ u32 max_blocks = queue_max_hw_sectors(ns->queue) >> (ns->lba_shift - 9);
num_cmds = nvme_trans_io_get_num_cmds(hdr, cdb_info, max_blocks);