scsi: target: core: Add cmd length set before cmd complete
stable inclusion from linux-4.19.181 commit 7abc17dced7593cf40a46f8f9b1aafd634a0ebb1 -------------------------------- [ Upstream commit 1c73e0c5 ] 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.com Reviewed-by:Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by:
Bodo Stroesser <bostroesser@gmail.com> Signed-off-by:
Aleksandr Miloserdov <a.miloserdov@yadro.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com> Signed-off-by:
Cheng Jian <cj.chengjian@huawei.com>
Loading
Please sign in to comment