]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
target/rd: fix or rewrite the copy routine
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 30 Nov 2011 09:48:30 +0000 (10:48 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 6 Dec 2011 06:00:58 +0000 (06:00 +0000)
commit65b0c78d5a0ca2cb82b7b9f54f855896e0d7fc10
tree64a27fa0aa08795154674909ccbf2106f56783eb
parent5bff9e8584fbcdb361dada5a0425724b9e31e608
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 <bigeasy@linutronix.de>
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_rd.c