> vhost_scsi_handle_vq() moves pi_bytesout and pi_bytesin into the
> protection sgl and subtracts them from exp_data_len.  The length passed
> to TCM is still exp_data_len + prot_bytes.
> 
> That sum matched an older target path which subtracted prot_length
> again.  sbc_check_prot() now replaces data_length from the CDB only
> when the protect field is non-zero, and only for READ and WRITE.
> target_cmd_size_check() leaves a write's data_length unchanged when the
> CDB size is smaller.
> 
> MODE SELECT, SET TARGET PORT GROUPS and UNMAP then use data_length as
> the size of t_data_sg.  The PI bytes are not in that sgl.  A parameter
> list that ends on a page is followed by a read of the next physical
> page.
> 
> [ ... ]
>   ret_from_fork
>   ret_from_fork_asm
> 
> Fixes: 9f977ef7b671 ("vhost-scsi: Include prot_bytes into expected data 
> transfer length")
> Signed-off-by: Jia Jia <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1


Reply via email to