linux/drivers/target
Nicholas Bellinger 410c29dfbf target: Fix ordered task CHECK_CONDITION early exception handling
If a Simple command is sent with a failure, target_setup_cmd_from_cdb
returns with TCM_UNSUPPORTED_SCSI_OPCODE or TCM_INVALID_CDB_FIELD.

So in the cases where target_setup_cmd_from_cdb returns an error, we
never get far enough to call target_execute_cmd to increment simple_cmds.
Since simple_cmds isn't incremented, the result of the failure from
target_setup_cmd_from_cdb causes transport_generic_request_failure to
decrement simple_cmds, due to call to transport_complete_task_attr.

With this dev->simple_cmds or dev->dev_ordered_sync is now -1, not 0.
So when a subsequent command with an Ordered Task is sent, it causes
a hang, since dev->simple_cmds is at -1.

Tested-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Tested-by: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Signed-off-by: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # 4.4+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2016-07-20 00:58:40 -07:00
..
iscsi target: Fix race between iscsi-target connection shutdown + ABORT_TASK 2016-07-20 00:58:34 -07:00
loopback target: make close_session optional 2016-05-10 01:19:26 -07:00
sbp target: make close_session optional 2016-05-10 01:19:26 -07:00
tcm_fc target: make ->shutdown_session optional 2016-05-10 01:19:18 -07:00
Kconfig
Makefile
target_core_alua.c target: use new "dbroot" target attribute 2016-05-09 23:06:20 -07:00
target_core_alua.h
target_core_configfs.c target: make close_session optional 2016-05-10 01:19:26 -07:00
target_core_device.c target: Fix max_unmap_lba_count calc overflow 2016-07-20 00:58:36 -07:00
target_core_fabric_configfs.c target: add a new add_wwn_groups fabrics method 2016-03-30 20:06:44 -07:00
target_core_fabric_lib.c
target_core_file.c target: Fix max_unmap_lba_count calc overflow 2016-07-20 00:58:36 -07:00
target_core_file.h
target_core_hba.c target: Fix target_sense_desc_format NULL pointer dereference 2015-09-24 23:17:23 -07:00
target_core_iblock.c target: Fix max_unmap_lba_count calc overflow 2016-07-20 00:58:36 -07:00
target_core_iblock.h
target_core_internal.h target: Fix ordered task target_setup_cmd_from_cdb exception hang 2016-07-20 00:58:38 -07:00
target_core_pr.c target: use new "dbroot" target attribute 2016-05-09 23:06:20 -07:00
target_core_pr.h
target_core_pscsi.c
target_core_pscsi.h
target_core_rd.c target: need_to_release is always false, remove redundant check and kfree 2016-05-10 01:19:55 -07:00
target_core_rd.h
target_core_sbc.c target: Fix ordered task target_setup_cmd_from_cdb exception hang 2016-07-20 00:58:38 -07:00
target_core_spc.c target: Remove enum transport_lunflags_table 2016-03-10 21:48:55 -08:00
target_core_stat.c configfs: switch ->default groups to a linked list 2016-03-06 16:11:24 +01:00
target_core_tmr.c target: Drop incorrect ABORT_TASK put for completed commands 2016-03-05 20:24:47 -08:00
target_core_tpg.c target: remove sess_kref and ->shutdown_session 2016-05-10 01:19:49 -07:00
target_core_transport.c target: Fix ordered task CHECK_CONDITION early exception handling 2016-07-20 00:58:40 -07:00
target_core_ua.c
target_core_ua.h
target_core_user.c target/user: Report capability of handling out-of-order completions to userspace 2016-03-10 21:49:09 -08:00
target_core_xcopy.c target: enhance and export target_alloc_sgl/target_free_sgl 2016-05-13 13:37:19 -04:00
target_core_xcopy.h