linux/drivers/target
Nicholas Bellinger 9d86a2befc iscsi-target: Fix ImmediateData=Yes failure regression in >= v3.10
This patch addresses a regression bug within ImmediateData=Yes failure
handling that ends up triggering an OOPs within >= v3.10 iscsi-target
code.

The problem occurs when iscsit_process_scsi_cmd() does the call to
target_put_sess_cmd(), and once again in iscsit_get_immediate_data()
that is triggered during two different cases:

 - When iscsit_sequence_cmd() returns CMDSN_LOWER_THAN_EXP, for which
   the descriptor state will already have been set to ISTATE_REMOVE
   by iscsit_sequence_cmd(), and
 - When iscsi_cmd->sense_reason is set, for which iscsit_execute_cmd()
   will have already called transport_send_check_condition_and_sense()
   to queue the exception response.

It changes iscsit_process_scsi_cmd() to drop the early call, and makes
iscsit_get_immediate_data() call target_put_sess_cmd() from a single
location after dumping the immediate data for the failed command.

The regression was initially introduced in commit:

commit 561bf15892
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Wed Jul 3 03:58:58 2013 -0700

    iscsi-target: Fix iscsit_sequence_cmd reject handling for iser

Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2013-08-22 00:45:51 -07:00
..
iscsi iscsi-target: Fix ImmediateData=Yes failure regression in >= v3.10 2013-08-22 00:45:51 -07:00
loopback target: make queue_tm_rsp() return void 2013-07-07 18:36:53 -07:00
sbp target: make queue_tm_rsp() return void 2013-07-07 18:36:53 -07:00
tcm_fc target: make queue_tm_rsp() return void 2013-07-07 18:36:53 -07:00
Kconfig sbp-target: Initial merge of firewire/ieee-1394 target mode support 2012-05-09 15:25:17 -07:00
Makefile target: move code for CDB emulation 2012-07-16 17:27:45 -07:00
target_core_alua.c target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs 2013-04-11 01:48:49 -07:00
target_core_alua.h target: pass sense_reason as a return value 2012-11-06 20:55:46 -08:00
target_core_configfs.c target: Alter core_pr_dump_initiator_port for ease of use 2013-06-14 00:04:31 -07:00
target_core_device.c target: Make virtual_lun0 a nullio device 2013-06-14 00:27:32 -07:00
target_core_fabric_configfs.c target: Add se_portal_group->tpg_auth_group 2013-07-03 19:44:31 -07:00
target_core_fabric_lib.c target: Update copyright information to 2012 2012-11-27 22:47:02 -08:00
target_core_file.c target/file: Fix off-by-one READ_CAPACITY bug for !S_ISBLK export 2013-05-30 17:46:27 -07:00
target_core_file.h target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os 2013-03-19 17:24:28 -07:00
target_core_hba.c target: Update copyright information to 2012 2012-11-27 22:47:02 -08:00
target_core_iblock.c target/iblock: Fix WCE=1 + DPOFUA=1 backend WRITE regression 2013-05-15 01:46:34 -07:00
target_core_iblock.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_internal.h target: Remove unused struct members in se_dev_entry 2013-05-03 16:42:18 -07:00
target_core_pr.c target: Make core_scsi3_update_and_write_aptpl return sense_reason_t 2013-07-03 19:44:33 -07:00
target_core_pr.h target: Alter core_pr_dump_initiator_port for ease of use 2013-06-14 00:04:31 -07:00
target_core_pscsi.c target/pscsi: Reject cross page boundary case in pscsi_map_sg 2013-03-19 17:31:14 -07:00
target_core_pscsi.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_rd.c target: Don't allocate pages for NULLIO devices 2013-06-14 00:27:36 -07:00
target_core_rd.h target/rd: Add ramdisk bit for NULLIO operation 2013-05-11 16:22:39 -07:00
target_core_sbc.c target: Add (obsolete) checking for PMI/LBA fields in READ CAPACITY(10) 2013-07-07 18:36:45 -07:00
target_core_spc.c target: Fix trailing ASCII space usage in INQUIRY vendor+model 2013-08-12 19:11:26 -07:00
target_core_stat.c target: Update copyright information to 2012 2012-11-27 22:47:02 -08:00
target_core_tmr.c target: Remove legacy t_fe_count + avoid t_state_lock access in transport_put_cmd 2013-06-20 14:10:41 -07:00
target_core_tpg.c target: fix possible memory leak in core_tpg_register() 2013-03-18 12:45:52 -07:00
target_core_transport.c target: Add tracepoints for SCSI commands being processed 2013-07-07 18:36:44 -07:00
target_core_ua.c target: Update copyright information to 2012 2012-11-27 22:47:02 -08:00
target_core_ua.h target: pass sense_reason as a return value 2012-11-06 20:55:46 -08:00