aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/iscsi/iscsi_target.c')
-rw-r--r--drivers/target/iscsi/iscsi_target.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 8a4092cd97ee..58fe27705b96 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1759,7 +1759,6 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
1759 struct iscsi_tmr_req *tmr_req; 1759 struct iscsi_tmr_req *tmr_req;
1760 struct iscsi_tm *hdr; 1760 struct iscsi_tm *hdr;
1761 int out_of_order_cmdsn = 0, ret; 1761 int out_of_order_cmdsn = 0, ret;
1762 bool sess_ref = false;
1763 u8 function, tcm_function = TMR_UNKNOWN; 1762 u8 function, tcm_function = TMR_UNKNOWN;
1764 1763
1765 hdr = (struct iscsi_tm *) buf; 1764 hdr = (struct iscsi_tm *) buf;
@@ -1801,18 +1800,17 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
1801 buf); 1800 buf);
1802 } 1801 }
1803 1802
1803 transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops,
1804 conn->sess->se_sess, 0, DMA_NONE,
1805 TCM_SIMPLE_TAG, cmd->sense_buffer + 2);
1806
1807 target_get_sess_cmd(&cmd->se_cmd, true);
1808
1804 /* 1809 /*
1805 * TASK_REASSIGN for ERL=2 / connection stays inside of 1810 * TASK_REASSIGN for ERL=2 / connection stays inside of
1806 * LIO-Target $FABRIC_MOD 1811 * LIO-Target $FABRIC_MOD
1807 */ 1812 */
1808 if (function != ISCSI_TM_FUNC_TASK_REASSIGN) { 1813 if (function != ISCSI_TM_FUNC_TASK_REASSIGN) {
1809 transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops,
1810 conn->sess->se_sess, 0, DMA_NONE,
1811 TCM_SIMPLE_TAG, cmd->sense_buffer + 2);
1812
1813 target_get_sess_cmd(&cmd->se_cmd, true);
1814 sess_ref = true;
1815
1816 switch (function) { 1814 switch (function) {
1817 case ISCSI_TM_FUNC_ABORT_TASK: 1815 case ISCSI_TM_FUNC_ABORT_TASK:
1818 tcm_function = TMR_ABORT_TASK; 1816 tcm_function = TMR_ABORT_TASK;
@@ -1951,12 +1949,8 @@ attach:
1951 * For connection recovery, this is also the default action for 1949 * For connection recovery, this is also the default action for
1952 * TMR TASK_REASSIGN. 1950 * TMR TASK_REASSIGN.
1953 */ 1951 */
1954 if (sess_ref) {
1955 pr_debug("Handle TMR, using sess_ref=true check\n");
1956 target_put_sess_cmd(&cmd->se_cmd);
1957 }
1958
1959 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); 1952 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state);
1953 target_put_sess_cmd(&cmd->se_cmd);
1960 return 0; 1954 return 0;
1961} 1955}
1962EXPORT_SYMBOL(iscsit_handle_task_mgt_cmd); 1956EXPORT_SYMBOL(iscsit_handle_task_mgt_cmd);