From: Sebastian Andrzej Siewior Date: Wed, 30 Nov 2011 09:48:30 +0000 (+0100) Subject: target/rd: fix or rewrite the copy routine X-Git-Tag: v3.2-rc5~31^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65b0c78d5a0ca2cb82b7b9f54f855896e0d7fc10;p=pandora-kernel.git target/rd: fix or rewrite the copy routine So the code assumes that the sg list is only a array while in reality loopback SGL memory via scsi_cmnd into target-core may be already chained. This patch converts ramdisk code to use sg_miter logic from scatterlist.h in order to properly support passthrough SGL usage with transport_generic_map_mem_to_cmd() via loopback. With this patch the bug goes away. However after umount/mount of the device my files are gone. So something is still not right. After looking at it for a while I decided to rewrite the that part of the code and now things do work for me. For reference: - http://article.gmane.org/gmane.linux.scsi.target.devel/595 the sg_next() conversion - http://article.gmane.org/gmane.linux.scsi.target.devel/602 the rewrite of the copy code (nab: Fix compile warning in rd_MEMCPY) Signed-off-by: Sebastian Andrzej Siewior Cc: stable@kernel.org Signed-off-by: Nicholas Bellinger --- Reading git-diff-tree failed