Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+19 -13
+11 -9
drivers/infiniband/ulp/isert/ib_isert.c
··· 586 586 init_completion(&isert_conn->conn_wait); 587 587 init_completion(&isert_conn->conn_wait_comp_err); 588 588 kref_init(&isert_conn->conn_kref); 589 - kref_get(&isert_conn->conn_kref); 590 589 mutex_init(&isert_conn->conn_mutex); 591 590 spin_lock_init(&isert_conn->conn_lock); 592 591 INIT_LIST_HEAD(&isert_conn->conn_fr_pool); 593 592 594 593 cma_id->context = isert_conn; 595 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 596 isert_conn->login_buf = kzalloc(ISCSI_DEF_MAX_RECV_SEG_LEN + 602 597 ISER_RX_LOGIN_SIZE, GFP_KERNEL); ··· 637 642 ret = PTR_ERR(device); 638 643 goto out_rsp_dma_map; 639 644 } 645 + 646 + /* Set max inflight RDMA READ requests */ 647 + isert_conn->initiator_depth = min_t(u8, 648 + event->param.conn.initiator_depth, 649 + device->dev_attr.max_qp_init_rd_atom); 650 + pr_debug("Using initiator_depth: %u\n", isert_conn->initiator_depth); 640 651 641 652 isert_conn->conn_device = device; 642 653 isert_conn->conn_pd = ib_alloc_pd(isert_conn->conn_device->ib_device); ··· 747 746 static void 748 747 isert_connected_handler(struct rdma_cm_id *cma_id) 749 748 { 750 - return; 749 + struct isert_conn *isert_conn = cma_id->context; 750 + 751 + kref_get(&isert_conn->conn_kref); 751 752 } 752 753 753 754 static void ··· 801 798 802 799 wake_up: 803 800 complete(&isert_conn->conn_wait); 804 - isert_put_conn(isert_conn); 805 801 } 806 802 807 803 static void ··· 3069 3067 int ret; 3070 3068 3071 3069 memset(&cp, 0, sizeof(struct rdma_conn_param)); 3072 - cp.responder_resources = isert_conn->responder_resources; 3073 3070 cp.initiator_depth = isert_conn->initiator_depth; 3074 3071 cp.retry_count = 7; 3075 3072 cp.rnr_retry_count = 7; ··· 3216 3215 pr_debug("isert_wait_conn: Starting \n"); 3217 3216 3218 3217 mutex_lock(&isert_conn->conn_mutex); 3219 - if (isert_conn->conn_cm_id) { 3218 + if (isert_conn->conn_cm_id && !isert_conn->disconnect) { 3220 3219 pr_debug("Calling rdma_disconnect from isert_wait_conn\n"); 3221 3220 rdma_disconnect(isert_conn->conn_cm_id); 3222 3221 } ··· 3235 3234 wait_for_completion(&isert_conn->conn_wait_comp_err); 3236 3235 3237 3236 wait_for_completion(&isert_conn->conn_wait); 3237 + isert_put_conn(isert_conn); 3238 3238 } 3239 3239 3240 3240 static void isert_free_conn(struct iscsi_conn *conn)
+3 -1
drivers/target/iscsi/iscsi_target.c
··· 4540 4540 { 4541 4541 struct iscsi_conn *l_conn; 4542 4542 struct iscsi_session *sess = conn->sess; 4543 + bool conn_found = false; 4543 4544 4544 4545 if (!sess) 4545 4546 return; ··· 4549 4548 list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) { 4550 4549 if (l_conn->cid == cid) { 4551 4550 iscsit_inc_conn_usage_count(l_conn); 4551 + conn_found = true; 4552 4552 break; 4553 4553 } 4554 4554 } 4555 4555 spin_unlock_bh(&sess->conn_lock); 4556 4556 4557 - if (!l_conn) 4557 + if (!conn_found) 4558 4558 return; 4559 4559 4560 4560 if (l_conn->sock)
+1 -1
drivers/target/iscsi/iscsi_target_parameters.c
··· 601 601 param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL); 602 602 if (!param_list) { 603 603 pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); 604 - goto err_out; 604 + return -1; 605 605 } 606 606 INIT_LIST_HEAD(&param_list->param_list); 607 607 INIT_LIST_HEAD(&param_list->extra_response_list);
+2
drivers/target/iscsi/iscsi_target_util.c
··· 400 400 401 401 spin_lock_bh(&conn->cmd_lock); 402 402 list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { 403 + if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) 404 + continue; 403 405 if (cmd->init_task_tag == init_task_tag) { 404 406 spin_unlock_bh(&conn->cmd_lock); 405 407 return cmd;
+1 -1
drivers/target/target_core_configfs.c
··· 2363 2363 pr_err("Invalid value '%ld', must be '0' or '1'\n", tmp); \ 2364 2364 return -EINVAL; \ 2365 2365 } \ 2366 - if (!tmp) \ 2366 + if (tmp) \ 2367 2367 t->_var |= _bit; \ 2368 2368 else \ 2369 2369 t->_var &= ~_bit; \
+1 -1
drivers/target/target_core_spc.c
··· 664 664 buf[0] = dev->transport->get_device_type(dev); 665 665 buf[3] = 0x0c; 666 666 put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]); 667 - put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[12]); 667 + put_unaligned_be32(dev->t10_alua.lba_map_segment_multiplier, &buf[12]); 668 668 669 669 return 0; 670 670 }