On Mon, 2015-04-13 at 23:21 +0900, Akinobu Mita wrote: > In fd_do_prot_rw(), it allocates prot_buf which is used to copy from > se_cmd->t_prot_sg by sbc_dif_copy_prot(). The SG table for prot_buf > is also initialized by allocating 'se_cmd->t_prot_nents' entries of > scatterlist and setting the data length of each entry to PAGE_SIZE > at most. > > However if se_cmd->t_prot_sg contains a clustered entry (i.e. > sg->length > PAGE_SIZE), the SG table for prot_buf can't be > initialized correctly and sbc_dif_copy_prot() can't copy to prot_buf. > (This actually happened with TCM loopback fabric module) > > As prot_buf is allocated by kzalloc() and it's physically contiguous, > we only need a single scatterlist entry. > > Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx> > Cc: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> > Cc: Sagi Grimberg <sagig@xxxxxxxxxxxx> > Cc: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> > Cc: "James E.J. Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> > Cc: target-devel@xxxxxxxxxxxxxxx > Cc: linux-scsi@xxxxxxxxxxxxxxx > --- > drivers/target/target_core_file.c | 21 ++++++--------------- > 1 file changed, 6 insertions(+), 15 deletions(-) > Applied to target-pending/for-next, with CC' for v3.14.y stable. Thanks Akinobu! -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html