diff options
author | Jenny Derzhavetz <jennyf@mellanox.com> | 2016-02-24 12:23:59 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2016-03-11 00:48:31 -0500 |
commit | aea92980601f7ddfcb3c54caa53a43726314fe46 (patch) | |
tree | d586c7ba9a6989499944dfd436d518e202e86875 /drivers/infiniband/ulp | |
parent | b89a7c25462b164db280abc3b05d4d9d888d40e9 (diff) |
iser-target: Add new state ISER_CONN_BOUND to isert_conn
We need an indication that isert_conn->iscsi_conn binding has
happened so we'll know not to invoke a connection reinstatement
on an unbound connection which will lead to a bogus isert_conn->conn
dereferece.
Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Cc: stable@vger.kernel.org # v3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 09ded3c704e5..320d3a55249c 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -825,7 +825,7 @@ isert_put_conn(struct isert_conn *isert_conn) | |||
825 | * @isert_conn: isert connection struct | 825 | * @isert_conn: isert connection struct |
826 | * | 826 | * |
827 | * Notes: | 827 | * Notes: |
828 | * In case the connection state is FULL_FEATURE, move state | 828 | * In case the connection state is BOUND, move state |
829 | * to TEMINATING and start teardown sequence (rdma_disconnect). | 829 | * to TEMINATING and start teardown sequence (rdma_disconnect). |
830 | * In case the connection state is UP, complete flush as well. | 830 | * In case the connection state is UP, complete flush as well. |
831 | * | 831 | * |
@@ -841,6 +841,7 @@ isert_conn_terminate(struct isert_conn *isert_conn) | |||
841 | case ISER_CONN_TERMINATING: | 841 | case ISER_CONN_TERMINATING: |
842 | break; | 842 | break; |
843 | case ISER_CONN_UP: | 843 | case ISER_CONN_UP: |
844 | case ISER_CONN_BOUND: | ||
844 | case ISER_CONN_FULL_FEATURE: /* FALLTHRU */ | 845 | case ISER_CONN_FULL_FEATURE: /* FALLTHRU */ |
845 | isert_info("Terminating conn %p state %d\n", | 846 | isert_info("Terminating conn %p state %d\n", |
846 | isert_conn, isert_conn->state); | 847 | isert_conn, isert_conn->state); |
@@ -2075,7 +2076,8 @@ isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc) | |||
2075 | isert_completion_put(desc, isert_cmd, ib_dev, true); | 2076 | isert_completion_put(desc, isert_cmd, ib_dev, true); |
2076 | } else { | 2077 | } else { |
2077 | isert_conn->post_recv_buf_count--; | 2078 | isert_conn->post_recv_buf_count--; |
2078 | if (!isert_conn->post_recv_buf_count) | 2079 | if (!isert_conn->post_recv_buf_count && |
2080 | isert_conn->state >= ISER_CONN_BOUND) | ||
2079 | iscsit_cause_connection_reinstatement(isert_conn->conn, 0); | 2081 | iscsit_cause_connection_reinstatement(isert_conn->conn, 0); |
2080 | } | 2082 | } |
2081 | } | 2083 | } |
@@ -3215,6 +3217,7 @@ accept_wait: | |||
3215 | 3217 | ||
3216 | conn->context = isert_conn; | 3218 | conn->context = isert_conn; |
3217 | isert_conn->conn = conn; | 3219 | isert_conn->conn = conn; |
3220 | isert_conn->state = ISER_CONN_BOUND; | ||
3218 | 3221 | ||
3219 | isert_set_conn_info(np, conn, isert_conn); | 3222 | isert_set_conn_info(np, conn, isert_conn); |
3220 | 3223 | ||
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h index 8d50453eef66..b80ec44fb4e1 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.h +++ b/drivers/infiniband/ulp/isert/ib_isert.h | |||
@@ -84,6 +84,7 @@ enum iser_ib_op_code { | |||
84 | enum iser_conn_state { | 84 | enum iser_conn_state { |
85 | ISER_CONN_INIT, | 85 | ISER_CONN_INIT, |
86 | ISER_CONN_UP, | 86 | ISER_CONN_UP, |
87 | ISER_CONN_BOUND, | ||
87 | ISER_CONN_FULL_FEATURE, | 88 | ISER_CONN_FULL_FEATURE, |
88 | ISER_CONN_TERMINATING, | 89 | ISER_CONN_TERMINATING, |
89 | ISER_CONN_DOWN, | 90 | ISER_CONN_DOWN, |