1
0
Fork 0
remarkable-linux/include/target
Nicholas Bellinger 08367c9e8f target: Fix remote-port TMR ABORT + se_cmd fabric stop
commit 0f4a943168 upstream.

To address the bug where fabric driver level shutdown
of se_cmd occurs at the same time when TMR CMD_T_ABORTED
is happening resulting in a -1 ->cmd_kref, this patch
adds a CMD_T_FABRIC_STOP bit that is used to determine
when TMR + driver I_T nexus shutdown is happening
concurrently.

It changes target_sess_cmd_list_set_waiting() to obtain
se_cmd->cmd_kref + set CMD_T_FABRIC_STOP, and drop local
reference in target_wait_for_sess_cmds() and invoke extra
target_put_sess_cmd() during Task Aborted Status (TAS)
when necessary.

Also, it adds a new target_wait_free_cmd() wrapper around
transport_wait_for_tasks() for the special case within
transport_generic_free_cmd() to set CMD_T_FABRIC_STOP,
and is now aware of CMD_T_ABORTED + CMD_T_TAS status
bits to know when an extra transport_put_cmd() during
TAS is required.

Note transport_generic_free_cmd() is expected to block on
cmd->cmd_wait_comp in order to follow what iscsi-target
expects during iscsi_conn context se_cmd shutdown.

Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@daterainc.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-03-05 22:11:42 -05:00
..
iscsi target/iscsi: Fix np_ip bracket issue by removing np_ip 2015-10-22 14:43:11 -07:00
configfs_macros.h doc: fix broken references 2011-09-27 18:08:04 +02:00
target_core_backend.h target: Use a PASSTHROUGH flag instead of transport_types 2015-05-30 19:58:11 -07:00
target_core_backend_configfs.h target: Drop left-over fabric_max_sectors attribute 2015-01-09 15:22:05 -08:00
target_core_base.h target: Fix remote-port TMR ABORT + se_cmd fabric stop 2016-03-05 22:11:42 -05:00
target_core_configfs.h target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem 2015-05-30 18:04:20 -07:00
target_core_fabric.h target: Remove first argument of target_{get,put}_sess_cmd() 2016-02-28 00:09:36 -05:00
target_core_fabric_configfs.h target: Add target_show_dynamic_sessions attribute helper 2015-03-06 21:24:53 -08:00