diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-13 01:38:32 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-13 01:38:32 -0400 |
| commit | ed9ea4ed3a44e8f8e8c7e8a12a05fd73f9ae1fb4 (patch) | |
| tree | f7275c1cade0a756d5b456dc23ccb692ff6073d5 | |
| parent | c1fdb2d3389c5a1e7c559a37a4967c1d2580e75c (diff) | |
| parent | 0ed6e189e3f6ac3a25383ed5cc8b0ac24c9b97b7 (diff) | |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target updates from Nicholas Bellinger:
"The highlights this round include:
- Add support for T10 PI pass-through between vhost-scsi +
virtio-scsi (MST + Paolo + MKP + nab)
- Add support for T10 PI in qla2xxx target mode (Quinn + MKP + hch +
nab, merged through scsi.git)
- Add support for percpu-ida pre-allocation in qla2xxx target code
(Quinn + nab)
- A number of iser-target fixes related to hardening the network
portal shutdown path (Sagi + Slava)
- Fix response length residual handling for a number of control CDBs
(Roland + Christophe V.)
- Various iscsi RFC conformance fixes in the CHAP authentication path
(Tejas and Calsoft folks + nab)
- Return TASK_SET_FULL status for tcm_fc(FCoE) DataIn + Response
failures (Vasu + Jun + nab)
- Fix long-standing ABORT_TASK + session reset hang (nab)
- Convert iser-initiator + iser-target to include T10 bytes into EDTL
(Sagi + Or + MKP + Mike Christie)
- Fix NULL pointer dereference regression related to XCOPY introduced
in v3.15 + CC'ed to v3.12.y (nab)"
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (34 commits)
target: Fix NULL pointer dereference for XCOPY in target_put_sess_cmd
vhost-scsi: Include prot_bytes into expected data transfer length
TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire
libiscsi, iser: Adjust data_length to include protection information
scsi_cmnd: Introduce scsi_transfer_length helper
target: Report correct response length for some commands
target/sbc: Check that the LBA and number of blocks are correct in VERIFY
target/sbc: Remove sbc_check_valid_sectors()
Target/iscsi: Fix sendtargets response pdu for iser transport
Target/iser: Fix a wrong dereference in case discovery session is over iser
iscsi-target: Fix ABORT_TASK + connection reset iscsi_queue_req memory leak
target: Use complete_all for se_cmd->t_transport_stop_comp
target: Set CMD_T_ACTIVE bit for Task Management Requests
target: cleanup some boolean tests
target/spc: Simplify INQUIRY EVPD=0x80
tcm_fc: Generate TASK_SET_FULL status for response failures
tcm_fc: Generate TASK_SET_FULL status for DataIN failures
iscsi-target: Reject mutual authentication with reflected CHAP_C
iscsi-target: Remove no-op from iscsit_tpg_del_portal_group
iscsi-target: Fix CHAP_A parameter list handling
...
30 files changed, 728 insertions, 364 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index 2e2d903db838..8d44a4060634 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c | |||
| @@ -41,11 +41,11 @@ | |||
| 41 | #include "iscsi_iser.h" | 41 | #include "iscsi_iser.h" |
| 42 | 42 | ||
| 43 | /* Register user buffer memory and initialize passive rdma | 43 | /* Register user buffer memory and initialize passive rdma |
| 44 | * dto descriptor. Total data size is stored in | 44 | * dto descriptor. Data size is stored in |
| 45 | * iser_task->data[ISER_DIR_IN].data_len | 45 | * task->data[ISER_DIR_IN].data_len, Protection size |
| 46 | * os stored in task->prot[ISER_DIR_IN].data_len | ||
| 46 | */ | 47 | */ |
| 47 | static int iser_prepare_read_cmd(struct iscsi_task *task, | 48 | static int iser_prepare_read_cmd(struct iscsi_task *task) |
| 48 | unsigned int edtl) | ||
| 49 | 49 | ||
| 50 | { | 50 | { |
| 51 | struct iscsi_iser_task *iser_task = task->dd_data; | 51 | struct iscsi_iser_task *iser_task = task->dd_data; |
| @@ -73,14 +73,6 @@ static int iser_prepare_read_cmd(struct iscsi_task *task, | |||
| 73 | return err; | 73 | return err; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | if (edtl > iser_task->data[ISER_DIR_IN].data_len) { | ||
| 77 | iser_err("Total data length: %ld, less than EDTL: " | ||
| 78 | "%d, in READ cmd BHS itt: %d, conn: 0x%p\n", | ||
| 79 | iser_task->data[ISER_DIR_IN].data_len, edtl, | ||
| 80 | task->itt, iser_task->ib_conn); | ||
| 81 | return -EINVAL; | ||
| 82 | } | ||
| 83 | |||
| 84 | err = device->iser_reg_rdma_mem(iser_task, ISER_DIR_IN); | 76 | err = device->iser_reg_rdma_mem(iser_task, ISER_DIR_IN); |
| 85 | if (err) { | 77 | if (err) { |
| 86 | iser_err("Failed to set up Data-IN RDMA\n"); | 78 | iser_err("Failed to set up Data-IN RDMA\n"); |
| @@ -100,8 +92,9 @@ static int iser_prepare_read_cmd(struct iscsi_task *task, | |||
| 100 | } | 92 | } |
| 101 | 93 | ||
| 102 | /* Register user buffer memory and initialize passive rdma | 94 | /* Register user buffer memory and initialize passive rdma |
| 103 | * dto descriptor. Total data size is stored in | 95 | * dto descriptor. Data size is stored in |
| 104 | * task->data[ISER_DIR_OUT].data_len | 96 | * task->data[ISER_DIR_OUT].data_len, Protection size |
| 97 | * is stored at task->prot[ISER_DIR_OUT].data_len | ||
| 105 | */ | 98 | */ |
| 106 | static int | 99 | static int |
| 107 | iser_prepare_write_cmd(struct iscsi_task *task, | 100 | iser_prepare_write_cmd(struct iscsi_task *task, |
| @@ -135,14 +128,6 @@ iser_prepare_write_cmd(struct iscsi_task *task, | |||
| 135 | return err; | 128 | return err; |
| 136 | } | 129 | } |
| 137 | 130 | ||
| 138 | if (edtl > iser_task->data[ISER_DIR_OUT].data_len) { | ||
| 139 | iser_err("Total data length: %ld, less than EDTL: %d, " | ||
| 140 | "in WRITE cmd BHS itt: %d, conn: 0x%p\n", | ||
| 141 | iser_task->data[ISER_DIR_OUT].data_len, | ||
| 142 | edtl, task->itt, task->conn); | ||
| 143 | return -EINVAL; | ||
| 144 | } | ||
| 145 | |||
| 146 | err = device->iser_reg_rdma_mem(iser_task, ISER_DIR_OUT); | 131 | err = device->iser_reg_rdma_mem(iser_task, ISER_DIR_OUT); |
| 147 | if (err != 0) { | 132 | if (err != 0) { |
| 148 | iser_err("Failed to register write cmd RDMA mem\n"); | 133 | iser_err("Failed to register write cmd RDMA mem\n"); |
| @@ -417,11 +402,12 @@ int iser_send_command(struct iscsi_conn *conn, | |||
| 417 | if (scsi_prot_sg_count(sc)) { | 402 | if (scsi_prot_sg_count(sc)) { |
| 418 | prot_buf->buf = scsi_prot_sglist(sc); | 403 | prot_buf->buf = scsi_prot_sglist(sc); |
| 419 | prot_buf->size = scsi_prot_sg_count(sc); | 404 | prot_buf->size = scsi_prot_sg_count(sc); |
| 420 | prot_buf->data_len = sc->prot_sdb->length; | 405 | prot_buf->data_len = data_buf->data_len >> |
| 406 | ilog2(sc->device->sector_size) * 8; | ||
| 421 | } | 407 | } |
| 422 | 408 | ||
| 423 | if (hdr->flags & ISCSI_FLAG_CMD_READ) { | 409 | if (hdr->flags & ISCSI_FLAG_CMD_READ) { |
| 424 | err = iser_prepare_read_cmd(task, edtl); | 410 | err = iser_prepare_read_cmd(task); |
| 425 | if (err) | 411 | if (err) |
| 426 | goto send_command_error; | 412 | goto send_command_error; |
| 427 | } | 413 | } |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index b9d647468b99..d4c7928a0f36 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -663,8 +663,9 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) | |||
| 663 | 663 | ||
| 664 | pi_support = np->tpg_np->tpg->tpg_attrib.t10_pi; | 664 | pi_support = np->tpg_np->tpg->tpg_attrib.t10_pi; |
| 665 | if (pi_support && !device->pi_capable) { | 665 | if (pi_support && !device->pi_capable) { |
| 666 | pr_err("Protection information requested but not supported\n"); | 666 | pr_err("Protection information requested but not supported, " |
| 667 | ret = -EINVAL; | 667 | "rejecting connect request\n"); |
| 668 | ret = rdma_reject(cma_id, NULL, 0); | ||
| 668 | goto out_mr; | 669 | goto out_mr; |
| 669 | } | 670 | } |
| 670 | 671 | ||
| @@ -787,14 +788,12 @@ isert_disconnect_work(struct work_struct *work) | |||
| 787 | isert_put_conn(isert_conn); | 788 | isert_put_conn(isert_conn); |
| 788 | return; | 789 | return; |
| 789 | } | 790 | } |
| 790 | if (!isert_conn->logout_posted) { | 791 | |
| 791 | pr_debug("Calling rdma_disconnect for !logout_posted from" | 792 | if (isert_conn->disconnect) { |
| 792 | " isert_disconnect_work\n"); | 793 | /* Send DREQ/DREP towards our initiator */ |
| 793 | rdma_disconnect(isert_conn->conn_cm_id); | 794 | rdma_disconnect(isert_conn->conn_cm_id); |
| 794 | mutex_unlock(&isert_conn->conn_mutex); | ||
| 795 | iscsit_cause_connection_reinstatement(isert_conn->conn, 0); | ||
| 796 | goto wake_up; | ||
| 797 | } | 795 | } |
| 796 | |||
| 798 | mutex_unlock(&isert_conn->conn_mutex); | 797 | mutex_unlock(&isert_conn->conn_mutex); |
| 799 | 798 | ||
| 800 | wake_up: | 799 | wake_up: |
