Skip to content

Commit 6cc44a6

Browse files
author
Nicholas Bellinger
committed
iser-target: Add missing target_put_sess_cmd for ImmedateData failure
This patch addresses a bug where an early exception for SCSI WRITE with ImmediateData=Yes was missing the target_put_sess_cmd() call to drop the extra se_cmd->cmd_kref reference obtained during the normal iscsit_setup_scsi_cmd() codepath execution. This bug was manifesting itself during session shutdown within isert_cq_rx_comp_err() where target_wait_for_sess_cmds() would end up waiting indefinately for the last se_cmd->cmd_kref put to occur for the failed SCSI WRITE + ImmediateData descriptors. This fix follows what traditional iscsi-target code already does for the same failure case within iscsit_get_immediate_data(). Reported-by: Sagi Grimberg <sagig@dev.mellanox.co.il> Cc: Sagi Grimberg <sagig@dev.mellanox.co.il> Cc: Or Gerlitz <ogerlitz@mellanox.com> Cc: stable@vger.kernel.org # 3.10+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 parent 1e1110c commit 6cc44a6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/infiniband/ulp/isert/ib_isert.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,8 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn,
12101210

12111211
if (!rc && dump_payload == false && unsol_data)
12121212
iscsit_set_unsoliticed_dataout(cmd);
1213+
else if (dump_payload && imm_data)
1214+
target_put_sess_cmd(conn->sess->se_sess, &cmd->se_cmd);
12131215

12141216
return 0;
12151217
}

0 commit comments

Comments
 (0)