]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] stex: stex_direct_copy shouldn't call dma_map_sg
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fri, 22 Feb 2008 14:11:03 +0000 (23:11 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 22 Feb 2008 23:20:39 +0000 (17:20 -0600)
commite13144a25777c50899d08c75f696d89e0d8d1b39
treec3f7825595819d4d607b642499616d3e5055bcb4
parentcbe31fbead3ebd189d0631a48c809a8a2bc31dc3
[SCSI] stex: stex_direct_copy shouldn't call dma_map_sg

stex_direct_copy copies an in-kernel buffer to a sg list in order to
spoof some SCSI commands. stex_direct_copy calls dma_map_sg and then
stex_internal_copy with the value that dma_map_sg returned. It calls
scsi_kmap_atomic_sg to copy data.

scsi_kmap_atomic_sg doesn't see sg->dma_length so if dma_map_sg merges
sg entries, stex_internal_copy gets the smaller number of sg entries
than the acutual number, which means it wrongly think that the data
length in the sg list is shorter than the actual length.

stex_direct_copy shouldn't call dma_map_sg and it doesn't need since
this code path doesn't involve dma transfers. This patch removes
stex_direct_copy and simply calls stex_internal_copy with the actual
number of sg entries.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Ed Lin <ed.lin@promise.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/stex.c