summaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2016-06-02 14:56:45 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2016-07-20 00:58:34 -0700
commit064cdd2d91c2805d788876082f31cc63506f22c3 (patch)
treeb868cab48c4c28bc253d804f459a4722092ee522 /include/target
parent5e2c956b8aa24d4f33ff7afef92d409eed164746 (diff)
downloadblackbird-obmc-linux-064cdd2d91c2805d788876082f31cc63506f22c3.tar.gz
blackbird-obmc-linux-064cdd2d91c2805d788876082f31cc63506f22c3.zip
target: Fix race between iscsi-target connection shutdown + ABORT_TASK
This patch fixes a race in iscsit_release_commands_from_conn() -> iscsit_free_cmd() -> transport_generic_free_cmd() + wait_for_tasks=1, where CMD_T_FABRIC_STOP could end up being set after the final kref_put() is called from core_tmr_abort_task() context. This results in transport_generic_free_cmd() blocking indefinately on se_cmd->cmd_wait_comp, because the target_release_cmd_kref() check for CMD_T_FABRIC_STOP returns false. To address this bug, make iscsit_release_commands_from_conn() do list_splice and set CMD_T_FABRIC_STOP early while holding iscsi_conn->cmd_lock. Also make iscsit_aborted_task() only remove iscsi_cmd_t if CMD_T_FABRIC_STOP has not already been set. Finally in target_release_cmd_kref(), only honor fabric_stop if CMD_T_ABORTED has been set. Cc: Mike Christie <mchristi@redhat.com> Cc: Quinn Tran <quinn.tran@qlogic.com> Cc: Himanshu Madhani <himanshu.madhani@qlogic.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: stable@vger.kernel.org # 3.14+ Tested-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud