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:
"This includes an important >= v3.6 regression bugfix for active I/O
shutdown (Roland), some TMR related failure / corner cases fixes for
long outstanding I/O (Roland), two FCoE target mode fabric fabric role
fixes (MDR), a fix for an incorrect sense code during LUN
communication failure (Dr. Hannes), plus a handful of other minor
fixes.

There are still some outstanding zero-length control CDB regression
fixes that need to be addressed for v3.8, that will be coming in a
follow-up PULL request."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
iscsi-target: Fix CmdSN comparison (use cmd->cmd_sn instead of cmd->stat_sn)
target: Release se_cmd when LUN lookup fails for TMR
target: Fix use-after-free in LUN RESET handling
target: Fix missing CMD_T_ACTIVE bit regression for pending WRITEs
tcm_fc: Do not report target role when target is not defined
tcm_fc: Do not indicate retry capability to initiators
target: Use TCM_NO_SENSE for initialisation
target: Introduce TCM_NO_SENSE
target: use correct sense code for LUN communication failure

+29 -10
+1 -1
drivers/target/iscsi/iscsi_target_erl2.c
··· 372 372 * made generic here. 373 373 */ 374 374 if (!(cmd->cmd_flags & ICF_OOO_CMDSN) && !cmd->immediate_cmd && 375 - iscsi_sna_gte(cmd->stat_sn, conn->sess->exp_cmd_sn)) { 375 + iscsi_sna_gte(cmd->cmd_sn, conn->sess->exp_cmd_sn)) { 376 376 list_del(&cmd->i_conn_node); 377 377 spin_unlock_bh(&conn->cmd_lock); 378 378 iscsit_free_cmd(cmd);
+1 -1
drivers/target/target_core_alua.c
··· 212 212 struct t10_alua_tg_pt_gp_member *tg_pt_gp_mem, *l_tg_pt_gp_mem; 213 213 unsigned char *buf; 214 214 unsigned char *ptr; 215 - sense_reason_t rc; 215 + sense_reason_t rc = TCM_NO_SENSE; 216 216 u32 len = 4; /* Skip over RESERVED area in header */ 217 217 int alua_access_state, primary = 0; 218 218 u16 tg_pt_id, rtpi;
+1 -1
drivers/target/target_core_pr.c
··· 2053 2053 /* Used for APTPL metadata w/ UNREGISTER */ 2054 2054 unsigned char *pr_aptpl_buf = NULL; 2055 2055 unsigned char isid_buf[PR_REG_ISID_LEN], *isid_ptr = NULL; 2056 - sense_reason_t ret; 2056 + sense_reason_t ret = TCM_NO_SENSE; 2057 2057 int pr_holder = 0, type; 2058 2058 2059 2059 if (!se_sess || !se_lun) {
+16 -4
drivers/target/target_core_transport.c
··· 541 541 542 542 void transport_cmd_finish_abort(struct se_cmd *cmd, int remove) 543 543 { 544 - if (!(cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) 545 - transport_lun_remove_cmd(cmd); 546 - 547 544 if (transport_cmd_check_stop_to_fabric(cmd)) 548 545 return; 549 546 if (remove) ··· 1393 1396 1394 1397 se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST; 1395 1398 se_cmd->se_tfo->queue_tm_rsp(se_cmd); 1399 + 1400 + transport_cmd_check_stop_to_fabric(se_cmd); 1396 1401 } 1397 1402 1398 1403 /** ··· 1687 1688 } 1688 1689 1689 1690 cmd->t_state = TRANSPORT_PROCESSING; 1691 + cmd->transport_state |= CMD_T_ACTIVE; 1690 1692 spin_unlock_irq(&cmd->t_state_lock); 1691 1693 1692 1694 if (!target_handle_task_attr(cmd)) ··· 2597 2597 * SENSE KEY values from include/scsi/scsi.h 2598 2598 */ 2599 2599 switch (reason) { 2600 + case TCM_NO_SENSE: 2601 + /* CURRENT ERROR */ 2602 + buffer[0] = 0x70; 2603 + buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10; 2604 + /* Not Ready */ 2605 + buffer[SPC_SENSE_KEY_OFFSET] = NOT_READY; 2606 + /* NO ADDITIONAL SENSE INFORMATION */ 2607 + buffer[SPC_ASC_KEY_OFFSET] = 0; 2608 + buffer[SPC_ASCQ_KEY_OFFSET] = 0; 2609 + break; 2600 2610 case TCM_NON_EXISTENT_LUN: 2601 2611 /* CURRENT ERROR */ 2602 2612 buffer[0] = 0x70; ··· 2753 2743 /* ILLEGAL REQUEST */ 2754 2744 buffer[SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST; 2755 2745 /* LOGICAL UNIT COMMUNICATION FAILURE */ 2756 - buffer[SPC_ASC_KEY_OFFSET] = 0x80; 2746 + buffer[SPC_ASC_KEY_OFFSET] = 0x08; 2757 2747 break; 2758 2748 } 2759 2749 /* ··· 2813 2803 } 2814 2804 } 2815 2805 cmd->scsi_status = SAM_STAT_TASK_ABORTED; 2806 + 2807 + transport_lun_remove_cmd(cmd); 2816 2808 2817 2809 pr_debug("Setting SAM_STAT_TASK_ABORTED status for CDB: 0x%02x," 2818 2810 " ITT: 0x%08x\n", cmd->t_task_cdb[0],
+9 -3
drivers/target/tcm_fc/tfc_sess.c
··· 355 355 356 356 tport = ft_tport_create(rdata->local_port); 357 357 if (!tport) 358 - return 0; /* not a target for this local port */ 358 + goto not_target; /* not a target for this local port */ 359 359 360 360 acl = ft_acl_get(tport->tpg, rdata); 361 361 if (!acl) 362 - return 0; 362 + goto not_target; /* no target for this remote */ 363 363 364 364 if (!rspp) 365 365 goto fill; ··· 396 396 397 397 /* 398 398 * OR in our service parameters with other provider (initiator), if any. 399 - * TBD XXX - indicate RETRY capability? 400 399 */ 401 400 fill: 402 401 fcp_parm = ntohl(spp->spp_params); 402 + fcp_parm &= ~FCP_SPPF_RETRY; 403 403 spp->spp_params = htonl(fcp_parm | FCP_SPPF_TARG_FCN); 404 404 return FC_SPP_RESP_ACK; 405 + 406 + not_target: 407 + fcp_parm = ntohl(spp->spp_params); 408 + fcp_parm &= ~FCP_SPPF_TARG_FCN; 409 + spp->spp_params = htonl(fcp_parm); 410 + return 0; 405 411 } 406 412 407 413 /**
+1
include/target/target_core_base.h
··· 174 174 175 175 enum tcm_sense_reason_table { 176 176 #define R(x) (__force sense_reason_t )(x) 177 + TCM_NO_SENSE = R(0x00), 177 178 TCM_NON_EXISTENT_LUN = R(0x01), 178 179 TCM_UNSUPPORTED_SCSI_OPCODE = R(0x02), 179 180 TCM_INCORRECT_AMOUNT_OF_DATA = R(0x03),