From: FUJITA Tomonori Date: Fri, 22 Feb 2008 14:11:04 +0000 (+0900) Subject: [SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb X-Git-Tag: v2.6.25-rc3~69^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9872fe1add5709fffd42249e6ca1080999aa06a;p=pandora-kernel.git [SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb stex_internal_copy copies an in-kernel buffer to a sg list by using scsi_kmap_atomic_sg. Some functions calls stex_internal_copy with sg_count in struct st_ccb, which is the value that dma_map_sg returned. However it might be shorter than the actual number of sg entries (if the IOMMU merged the sg entries). scsi_kmap_atomic_sg doesn't see sg->dma_length so stex_internal_copy should be called with the actual number of sg entries (i.e. scsi_sg_count), because if the sg entries were merged, stex_direct_copy wrongly think that the data length in the sg list is shorter than the actual length. Signed-off-by: FUJITA Tomonori Acked-by: Ed Lin Signed-off-by: James Bottomley --- Reading git-diff-tree failed