iser-target: Fix session hang in case of an rdma read DIF error
authorSagi Grimberg <sagig@mellanox.com>
Sun, 29 Mar 2015 12:52:03 +0000 (15:52 +0300)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:13 +0000 (19:12 -0400)
[ Upstream commit 364189f0ada5478e4faf8a552d6071a650d757cd ]

This hang was a result of a missing command put when
a DIF error occurred during a rdma read (and we sent
an CHECK_CONDITION error without passing it to the
backend).

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/infiniband/ulp/isert/ib_isert.c

index a6daabc..0618e40 100644 (file)
@@ -1900,11 +1900,13 @@ isert_completion_rdma_read(struct iser_tx_desc *tx_desc,
        cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT;
        spin_unlock_bh(&cmd->istate_lock);
 
-       if (ret)
+       if (ret) {
+               target_put_sess_cmd(se_cmd->se_sess, se_cmd);
                transport_send_check_condition_and_sense(se_cmd,
                                                         se_cmd->pi_err, 0);
-       else
+       } else {
                target_execute_cmd(se_cmd);
+       }
 }
 
 static void