scsi: target: core: Add cmd length set before cmd complete
TCM doesn't properly handle underflow case for service actions. One way to prevent it is to always complete command with target_complete_cmd_with_length(), however it requires access to data_sg, which is not always available. This change introduces target_set_cmd_data_length() function which allows to set command data length before completing it. Link: https://lore.kernel.org/r/20210209072202.41154-2-a.miloserdov@yadro.comReviewed-by: NRoman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: NBodo Stroesser <bostroesser@gmail.com> Signed-off-by: NAleksandr Miloserdov <a.miloserdov@yadro.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Showing
想要评论请 注册 或 登录