]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet-fc: fix target sgl list on large transfers
authorJames Smart <jsmart2021@gmail.com>
Mon, 16 Jul 2018 21:38:14 +0000 (14:38 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 24 Jul 2018 11:44:09 +0000 (13:44 +0200)
commit2834b9cbe0b444e3b6d571775d9823475d6ee015
treeaba62b040834140884f42e0aed2ec08580fdc834
parent2b7273d6199d05eda0a3b4f396412fdc80b1c058
nvmet-fc: fix target sgl list on large transfers

The existing code to carve up the sg list expected an sg element-per-page
which can be very incorrect with iommu's remapping multiple memory pages
to fewer bus addresses. To hit this error required a large io payload
(greater than 256k) and a system that maps on a per-page basis. It's
possible that large ios could get by fine if the system condensed the
sgl list into the first 64 elements.

This patch corrects the sg list handling by specifically walking the
sg list element by element and attempting to divide the transfer up
on a per-sg element boundary. While doing so, it still tries to keep
sequences under 256k, but will exceed that rule if a single sg element
is larger than 256k.

Fixes: 9b1c94f25ee7 ("nvmet-fc: simplify sg list handling")
Cc: <stable@vger.kernel.org> # 4.14
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fc.c