]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
target: Fix race with SCF_SEND_DELAYED_TAS handling
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 5 Feb 2016 22:51:36 +0000 (14:51 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:24:00 +0000 (10:24 +0100)
commit5f9b1c474e47e8bed53478a6f5a5d5f90c0fe507
tree44c735e27aa6773167ff41e86a8d091b5d8f6dac
parent49fd509dc704af415171f94884aa3c0cf9059f15
target: Fix race with SCF_SEND_DELAYED_TAS handling

BugLink: http://bugs.launchpad.net/bugs/1553179
commit 310d3d314be7f0a84011ebdc4bdccbcae9755a87 upstream.

This patch fixes a race between setting of SCF_SEND_DELAYED_TAS
in transport_send_task_abort(), and check of the same bit in
transport_check_aborted_status().

It adds a __transport_check_aborted_status() version that is
used by target_execute_cmd() when se_cmd->t_state_lock is
held, and a transport_check_aborted_status() wrapper for
all other existing callers.

Also, it handles the case where the check happens before
transport_send_task_abort() gets called.  For this, go
ahead and set SCF_SEND_DELAYED_TAS early when necessary,
and have transport_send_task_abort() send the abort.

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@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/target/target_core_transport.c