summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_configfs.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2013-12-17 09:18:49 +0100
committerNicholas Bellinger <nab@linux-iscsi.org>2014-01-09 21:48:17 -0800
commitc66094bf325ee406b92298d73089ee25484a0263 (patch)
treecfa2fb231dbd3e120ad2d75f96c250c24233978a /drivers/target/target_core_configfs.c
parentfbfe858fea2a45df6339eb03dd1715b51f1bdc92 (diff)
downloadop-kernel-dev-c66094bf325ee406b92298d73089ee25484a0263.zip
op-kernel-dev-c66094bf325ee406b92298d73089ee25484a0263.tar.gz
target_core_alua: Referrals infrastructure
Add infrastructure for referrals. v2 changes: - Fix unsigned long long division in core_alua_state_lba_dependent on 32-bit (Fengguang + Chen + Hannes) - Fix compile warning in core_alua_state_lba_dependent (nab) - Convert segment_* + sectors variables in core_alua_state_lba_dependent to u64 (Hannes) Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_configfs.c')
-rw-r--r--drivers/target/target_core_configfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index a1c23d1..e0a47f5 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -2054,6 +2054,13 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_state(
" transition while TPGS_IMPLICIT_ALUA is disabled\n");
return -EINVAL;
}
+ if (tg_pt_gp->tg_pt_gp_alua_access_type & TPGS_EXPLICIT_ALUA &&
+ new_state == ALUA_ACCESS_STATE_LBA_DEPENDENT) {
+ /* LBA DEPENDENT is only allowed with implicit ALUA */
+ pr_err("Unable to process implicit configfs ALUA transition"
+ " while explicit ALUA management is enabled\n");
+ return -EINVAL;
+ }
ret = core_alua_do_port_transition(tg_pt_gp, dev,
NULL, NULL, new_state, 0);
@@ -2188,7 +2195,7 @@ SE_DEV_ALUA_SUPPORT_STATE_SHOW(lba_dependent,
tg_pt_gp_alua_supported_states, ALUA_LBD_SUP);
SE_DEV_ALUA_SUPPORT_STATE_STORE(lba_dependent,
tg_pt_gp_alua_supported_states, ALUA_LBD_SUP);
-SE_DEV_ALUA_TG_PT_ATTR(alua_support_lba_dependent, S_IRUGO | S_IWUSR);
+SE_DEV_ALUA_TG_PT_ATTR(alua_support_lba_dependent, S_IRUGO);
SE_DEV_ALUA_SUPPORT_STATE_SHOW(unavailable,
tg_pt_gp_alua_supported_states, ALUA_U_SUP);
OpenPOWER on IntegriCloud