diff mbox series

[13/36] target: Don't respond TMR_LUN_DOES_NOT_EXIST for all TMR failure

Message ID 17031426bf0084a5342b9ed404368361bef7c50f.1657149962.git.Thinh.Nguyen@synopsys.com (mailing list archive)
State Superseded
Headers show
Series usb: gadget: f_tcm: Enhance UASP driver | expand

Commit Message

Thinh Nguyen July 6, 2022, 11:35 p.m. UTC
Not every Task Management failure is due to TMR_LUN_DOES_NOT_EXIST,
which is currently being set if target_complete_tmr_failure() is
executed. Only set this response where it should apply.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 drivers/target/target_core_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 2fc4ba1814c6..930bf8779d87 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1916,7 +1916,6 @@  static void target_complete_tmr_failure(struct work_struct *work)
 {
 	struct se_cmd *se_cmd = container_of(work, struct se_cmd, work);
 
-	se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST;
 	se_cmd->se_tfo->queue_tm_rsp(se_cmd);
 
 	transport_lun_remove_cmd(se_cmd);
@@ -1983,6 +1982,7 @@  int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
 	 * to process context with TMR_LUN_DOES_NOT_EXIST status.
 	 */
 failure:
+	se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST;
 	INIT_WORK(&se_cmd->work, target_complete_tmr_failure);
 	schedule_work(&se_cmd->work);
 	return 0;