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 <[email protected]>
> Cc: Nicholas Bellinger <[email protected]>
> Cc: Sagi Grimberg <[email protected]>
> Cc: "Martin K. Petersen" <[email protected]>
> Cc: Christoph Hellwig <[email protected]>
> Cc: "James E.J. Bottomley" <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
>  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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to