[RFC v2 21/21] nvme-pci: don't allow mapping of bvecs with offset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Leon Romanovsky <leonro@xxxxxxxxxx>

It is a hack, but direct DMA works now.

Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
---
 drivers/nvme/host/pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 881cbf2c0cac..1872fa91ac76 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -791,6 +791,9 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
 			return BLK_STS_RESOURCE;
 
 		rq_for_each_bvec(bv, req, iter) {
+			if (bv.bv_offset != 0)
+				goto out_free;
+
 			dma_addr = dma_map_bvec(dev->dev, &bv, rq_dma_dir(req), 0);
 			if (dma_mapping_error(dev->dev, dma_addr))
 				goto out_free;
-- 
2.46.0





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux