[PATCH 05/36] target: Don't remove command too early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A command completion is asynchronous, regardless if an abort command is
executed. Don't just free the command before its completion. Similarly,
a TMR command is not completed until its response is completed. The
freeing of the command can be done by the target user through
target_generic_free_cmd().

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx>
---
 drivers/target/target_core_transport.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 7838dc20f713..105d3b0e470f 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -836,10 +836,6 @@ static void target_handle_abort(struct se_cmd *cmd)
 	}
 
 	WARN_ON_ONCE(kref_read(&cmd->cmd_kref) == 0);
-
-	transport_lun_remove_cmd(cmd);
-
-	transport_cmd_check_stop_to_fabric(cmd);
 }
 
 static void target_abort_work(struct work_struct *work)
@@ -3553,9 +3549,6 @@ static void target_tmr_work(struct work_struct *work)
 		goto aborted;
 
 	cmd->se_tfo->queue_tm_rsp(cmd);
-
-	transport_lun_remove_cmd(cmd);
-	transport_cmd_check_stop_to_fabric(cmd);
 	return;
 
 aborted:
-- 
2.28.0




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux