]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
target/rd: Don't pass incomplete scatterlist entries to sbc_dif_verify_*
authorAkinobu Mita <akinobu.mita@gmail.com>
Sat, 11 Apr 2015 04:17:31 +0000 (13:17 +0900)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 14 Apr 2015 19:37:42 +0000 (12:37 -0700)
commitbfd9a53e0110442eeef670227907bdd14def94e1
treeb725f4a0aa3f27bd7497515a21bba4cd7e002de9
parent054922bb3549abbea9ed2c1a78a1e331343cc05e
target/rd: Don't pass incomplete scatterlist entries to sbc_dif_verify_*

The scatterlist for protection information which is passed to
sbc_dif_verify_read() or sbc_dif_verify_write() requires that
neighboring scatterlist entries are contiguous or chained so that they
can be iterated by sg_next().

However, the protection information for RD-MCP backends could be located
in the multiple scatterlist arrays when the ramdisk space is too large.
So if the read/write request straddles this boundary, sbc_dif_verify_read()
or sbc_dif_verify_write() can't iterate all scatterlist entries.

This problem can be fixed by chaining protection information scatterlist
at creation time.  For the architectures which don't support sg chaining
(i.e. !CONFIG_ARCH_HAS_SG_CHAIN), fix it by allocating temporary
scatterlist if needed.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: target-devel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_rd.c