diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-20 13:41:38 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-20 13:41:38 -0400 |
| commit | 0d9514334bb00355206d17d50474d2613656113f (patch) | |
| tree | 916524d9918af02c7ffc3d8ca0d49705fa418163 /drivers/infiniband/ulp | |
| parent | 1734a6e47fbad93f896644ad8ad12574fadba49d (diff) | |
| parent | 8ae757d09c45102b347a1bc2867f54ffc1ab8fda (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target fixes from Nicholas Bellinger:
"Here are the target pending fixes for v3.17-rc6.
Included are Sagi's long overdue fixes related to iser-target
shutdown, along with a couple of fixes from Sebastian related to ALUA
Referrals changes that when in during the v3.14 time-frame.
Also included are a few iscsi-target fixes, most recently of which
where found during Joern's Coverity scanning of target code"
* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure
iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid
target: Fix inverted logic in SE_DEV_ALUA_SUPPORT_STATE_STORE
target: Fix user data segment multiplier in spc_emulate_evpd_b3()
iscsi-target: Ignore ICF_GOT_LAST_DATAOUT during Data-Out ITT lookup
Target/iser: Fix initiator_depth and responder_resources
Target/iser: Avoid calling rdma_disconnect twice
Target/iser: Don't put isert_conn inside disconnected handler
Target/iser: Get isert_conn reference once got to connected_handler
Diffstat (limited to 'drivers/infiniband/ulp')
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index d4c7928a0f36..da8ff124762a 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -586,17 +586,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 586 | init_completion(&isert_conn->conn_wait); | 586 | init_completion(&isert_conn->conn_wait); |
| 587 | init_completion(&isert_conn->conn_wait_comp_err); | 587 | init_completion(&isert_conn->conn_wait_comp_err); |
| 588 | kref_init(&isert_conn->conn_kref); | 588 | kref_init(&isert_conn->conn_kref); |
| 589 | kref_get(&isert_conn->conn_kref); | ||
| 590 | mutex_init(&isert_conn->conn_mutex); | 589 | mutex_init(&isert_conn->conn_mutex); |
| 591 | spin_lock_init(&isert_conn->conn_lock); | 590 | spin_lock_init(&isert_conn->conn_lock); |
| 592 | INIT_LIST_HEAD(&isert_conn->conn_fr_pool); | 591 | INIT_LIST_HEAD(&isert_conn->conn_fr_pool); |
| 593 | 592 | ||
| 594 | cma_id->context = isert_conn; | 593 | cma_id->context = isert_conn; |
| 595 | isert_conn->conn_cm_id = cma_id; | 594 | isert_conn->conn_cm_id = cma_id; |
| 596 | isert_conn->responder_resources = event->param.conn.responder_resources; | ||
| 597 | isert_conn->initiator_depth = event->param.conn.initiator_depth; | ||
| 598 | pr_debug("Using responder_resources: %u initiator_depth: %u\n", | ||
| 599 | isert_conn->responder_resources, isert_conn->initiator_depth); | ||
| 600 | 595 | ||
| 601 | isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + | 596 | isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + |
| 602 | ISER_RX_LOGIN_SIZE, GFP_KERNEL); | 597 | ISER_RX_LOGIN_SIZE, GFP_KERNEL); |
| @@ -643,6 +638,12 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 643 | goto out_rsp_dma_map; | 638 | goto out_rsp_dma_map; |
| 644 | } | 639 | } |
| 645 | 640 | ||
| 641 | /* Set max inflight RDMA READ requests */ | ||
| 642 | isert_conn->initiator_depth = min_t(u8, | ||
| 643 | event->param.conn.initiator_depth, | ||
| 644 | device->dev_attr.max_qp_init_rd_atom); | ||
| 645 | pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth); | ||
| 646 | |||
| 646 | isert_conn->conn_device = device; | 647 | isert_conn->conn_device = device; |
| 647 | isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); | 648 | isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); |
| 648 | if (IS_ERR(isert_conn->conn_pd)) { | 649 | if (IS_ERR(isert_conn->conn_pd)) { |
| @@ -746,7 +747,9 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
| 746 | static void | 747 | static void |
| 747 | isert_connected_handler(struct rdma_cm_id *cma_id) | 748 | isert_connected_handler(struct rdma_cm_id *cma_id) |
| 748 | { | 749 | { |
| 749 | return; | 750 | struct isert_conn *isert_conn = cma_id->context; |
| 751 | |||
| 752 | kref_get(&isert_conn->conn_kref); | ||
| 750 | } | 753 | } |
| 751 | 754 | ||
| 752 | static void | 755 | static void |
| @@ -798,7 +801,6 @@ isert_disconnect_work(struct work_struct *work) | |||
| 798 | 801 | ||
| 799 | wake_up: | 802 | wake_up: |
| 800 | complete(&isert_conn->conn_wait); | 803 | complete(&isert_conn->conn_wait); |
| 801 | isert_put_conn(isert_conn); | ||
| 802 | } | 804 | } |
| 803 | 805 | ||
| 804 | static void | 806 | static void |
| @@ -3067,7 +3069,6 @@ isert_rdma_accept(struct isert_conn *isert_conn) | |||
| 3067 | int ret; | 3069 | int ret; |
| 3068 | 3070 | ||
| 3069 | memset(&cp, 0, sizeof(struct rdma_conn_param)); | 3071 | memset(&cp, 0, sizeof(struct rdma_conn_param)); |
| 3070 | cp.responder_resources = isert_conn->responder_resources; | ||
| 3071 | cp.initiator_depth = isert_conn->initiator_depth; | 3072 | cp.initiator_depth = isert_conn->initiator_depth; |
| 3072 | cp.retry_count = 7; | 3073 | cp.retry_count = 7; |
| 3073 | cp.rnr_retry_count = 7; | 3074 | cp.rnr_retry_count = 7; |
| @@ -3215,7 +3216,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) | |||
| 3215 | pr_debug("isert_wait_conn: Starting \n"); | 3216 | pr_debug("isert_wait_conn: Starting \n"); |
| 3216 | 3217 | ||
| 3217 | mutex_lock(&isert_conn->conn_mutex); | 3218 | mutex_lock(&isert_conn->conn_mutex); |
| 3218 | if (isert_conn->conn_cm_id) { | 3219 | if (isert_conn->conn_cm_id && !isert_conn->disconnect) { |
| 3219 | pr_debug("Calling rdma_disconnect from isert_wait_conn\n"); | 3220 | pr_debug("Calling rdma_disconnect from isert_wait_conn\n"); |
| 3220 | rdma_disconnect(isert_conn->conn_cm_id); | 3221 | rdma_disconnect(isert_conn->conn_cm_id); |
| 3221 | } | 3222 | } |
| @@ -3234,6 +3235,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) | |||
| 3234 | wait_for_completion(&isert_conn->conn_wait_comp_err); | 3235 | wait_for_completion(&isert_conn->conn_wait_comp_err); |
| 3235 | 3236 | ||
| 3236 | wait_for_completion(&isert_conn->conn_wait); | 3237 | wait_for_completion(&isert_conn->conn_wait); |
| 3238 | isert_put_conn(isert_conn); | ||
| 3237 | } | 3239 | } |
| 3238 | 3240 | ||
| 3239 | static void isert_free_conn(struct iscsi_conn *conn) | 3241 | static void isert_free_conn(struct iscsi_conn *conn) |
