Re: [PATCH 3/5] target: Release se_cmd when LUN lookup fails for TMR

2013-01-10 Thread Nicholas A. Bellinger
On Wed, 2013-01-02 at 12:47 -0800, Roland Dreier wrote:
 From: Roland Dreier rol...@purestorage.com
 
 When transport_lookup_tmr_lun() fails and we return a task management
 response from target_complete_tmr_failure(), we need to call
 transport_cmd_check_stop_to_fabric() to release the last ref to the
 cmd after calling se_tfo-queue_tm_rsp(), or else we will never remove
 the failed TMR from the session command list (and we'll end up waiting
 forever when trying to tear down the session).
 
 Signed-off-by: Roland Dreier rol...@purestorage.com
 ---
  drivers/target/target_core_transport.c | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/target/target_core_transport.c 
 b/drivers/target/target_core_transport.c
 index 49390d8..fe6208f 100644
 --- a/drivers/target/target_core_transport.c
 +++ b/drivers/target/target_core_transport.c
 @@ -1393,6 +1393,8 @@ static void target_complete_tmr_failure(struct 
 work_struct *work)
  
   se_cmd-se_tmr_req-response = TMR_LUN_DOES_NOT_EXIST;
   se_cmd-se_tfo-queue_tm_rsp(se_cmd);
 +
 + transport_cmd_check_stop_to_fabric(cmd);
  }
  
  /**

Looks good.  CC'ing to stable as well.

--nab


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/5] target: Release se_cmd when LUN lookup fails for TMR

2013-01-02 Thread Roland Dreier
From: Roland Dreier rol...@purestorage.com

When transport_lookup_tmr_lun() fails and we return a task management
response from target_complete_tmr_failure(), we need to call
transport_cmd_check_stop_to_fabric() to release the last ref to the
cmd after calling se_tfo-queue_tm_rsp(), or else we will never remove
the failed TMR from the session command list (and we'll end up waiting
forever when trying to tear down the session).

Signed-off-by: Roland Dreier rol...@purestorage.com
---
 drivers/target/target_core_transport.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/target/target_core_transport.c 
b/drivers/target/target_core_transport.c
index 49390d8..fe6208f 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1393,6 +1393,8 @@ static void target_complete_tmr_failure(struct 
work_struct *work)
 
se_cmd-se_tmr_req-response = TMR_LUN_DOES_NOT_EXIST;
se_cmd-se_tfo-queue_tm_rsp(se_cmd);
+
+   transport_cmd_check_stop_to_fabric(cmd);
 }
 
 /**
-- 
1.8.0

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html