summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_alua.c
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2017-03-02 08:13:25 +0300
committerNicholas Bellinger <nab@linux-iscsi.org>2017-03-19 00:47:26 +0300
commit0a4145729871ef29afe8b0c57560a1f5bd736416 (patch)
tree1a6dbe2b6d25b3d1791192824ea4c6205405a51b /drivers/target/target_core_alua.c
parent530c6891b1220cba780b6c18f4691d85a3435080 (diff)
downloadlinux-0a4145729871ef29afe8b0c57560a1f5bd736416.tar.xz
target: fail ALUA transitions for pscsi
We do not setup the LU group for pscsi devices, so if you write a state to alua_access_state that will cause a transition you will get a NULL pointer dereference. This patch will fail attempts to try and transition the path for backend devices that set the TRANSPORT_FLAG_PASSTHROUGH_ALUA flag. Signed-off-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_alua.c')
-rw-r--r--drivers/target/target_core_alua.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index a41bbb8087cf..5b5a1e250a65 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -1149,6 +1149,9 @@ int core_alua_do_port_transition(
struct t10_alua_tg_pt_gp *tg_pt_gp;
int primary, valid_states, rc = 0;
+ if (l_dev->transport->transport_flags & TRANSPORT_FLAG_PASSTHROUGH_ALUA)
+ return -ENODEV;
+
valid_states = l_tg_pt_gp->tg_pt_gp_alua_supported_states;
if (core_alua_check_transition(new_state, valid_states, &primary) != 0)
return -EINVAL;