diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-11-02 06:33:16 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-11-02 11:58:30 -0400 |
commit | 88dd9e26d6d3e743f9c7e4562b94b2ad3c2994d3 (patch) | |
tree | 452154b4137170de74d4445c5fcbbf62ce2f04fd /drivers/target/loopback | |
parent | 5a4c8666c6d576f076a7c6824589cdbb984c0f84 (diff) |
target: Make TFO->check_stop_free return free status
This patch converts target_core_fabric_ops->check_stop_free() usage in
transport_cmd_check_stop() and associated fabric module usage to
return '1' when the passed se_cmd has been released directly within
->check_stop_free(), or return '0' when the passed se_cmd has not
been released.
This addresses an issue where transport_cmd_finish_abort() ->
transport_cmd_check_stop_to_fabric() was leaking descriptors during
LUN_RESET for modules using ->check_stop_free(), but not directly
releasing se_cmd in all cases.
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
Diffstat (limited to 'drivers/target/loopback')
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 3c9c318f66ed..3df1c9b8ae6b 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -205,7 +205,7 @@ static int tcm_loop_new_cmd_map(struct se_cmd *se_cmd) | |||
205 | /* | 205 | /* |
206 | * Called from struct target_core_fabric_ops->check_stop_free() | 206 | * Called from struct target_core_fabric_ops->check_stop_free() |
207 | */ | 207 | */ |
208 | static void tcm_loop_check_stop_free(struct se_cmd *se_cmd) | 208 | static int tcm_loop_check_stop_free(struct se_cmd *se_cmd) |
209 | { | 209 | { |
210 | /* | 210 | /* |
211 | * Do not release struct se_cmd's containing a valid TMR | 211 | * Do not release struct se_cmd's containing a valid TMR |
@@ -213,12 +213,13 @@ static void tcm_loop_check_stop_free(struct se_cmd *se_cmd) | |||
213 | * with transport_generic_free_cmd(). | 213 | * with transport_generic_free_cmd(). |
214 | */ | 214 | */ |
215 | if (se_cmd->se_tmr_req) | 215 | if (se_cmd->se_tmr_req) |
216 | return; | 216 | return 0; |
217 | /* | 217 | /* |
218 | * Release the struct se_cmd, which will make a callback to release | 218 | * Release the struct se_cmd, which will make a callback to release |
219 | * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd() | 219 | * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd() |
220 | */ | 220 | */ |
221 | transport_generic_free_cmd(se_cmd, 0); | 221 | transport_generic_free_cmd(se_cmd, 0); |
222 | return 1; | ||
222 | } | 223 | } |
223 | 224 | ||
224 | static void tcm_loop_release_cmd(struct se_cmd *se_cmd) | 225 | static void tcm_loop_release_cmd(struct se_cmd *se_cmd) |