aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-09-30 15:20:02 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-10-02 16:17:34 -0400
commit38b11bae6ba02da352340aff12ee25755977b222 (patch)
treeaf9042a540a61d7bffb5948e31a548e3fdc6822a /drivers/target
parentb094a4bd840e6f268f70a79a099debaf235e44e5 (diff)
iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG demo-mode
We've had reports in the past about this specific case, so it's time to go ahead and explicitly set cache_dynamic_acls=1 for generate_node_acls=1 (TPG demo-mode) operation. During normal generate_node_acls=0 operation with explicit NodeACLs -> se_node_acl memory is persistent to the configfs group located at /sys/kernel/config/target/$TARGETNAME/$TPGT/acls/$INITIATORNAME, so in the generate_node_acls=1 case we want the reservation logic to reference existing per initiator IQN se_node_acl memory (not to generate a new se_node_acl), so go ahead and always set cache_dynamic_acls=1 when TPG demo-mode is enabled. Reported-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/iscsi_target_tpg.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index a38a3f8ab0d9..de9ea32b6104 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -677,6 +677,12 @@ int iscsit_ta_generate_node_acls(
677 pr_debug("iSCSI_TPG[%hu] - Generate Initiator Portal Group ACLs: %s\n", 677 pr_debug("iSCSI_TPG[%hu] - Generate Initiator Portal Group ACLs: %s\n",
678 tpg->tpgt, (a->generate_node_acls) ? "Enabled" : "Disabled"); 678 tpg->tpgt, (a->generate_node_acls) ? "Enabled" : "Disabled");
679 679
680 if (flag == 1 && a->cache_dynamic_acls == 0) {
681 pr_debug("Explicitly setting cache_dynamic_acls=1 when "
682 "generate_node_acls=1\n");
683 a->cache_dynamic_acls = 1;
684 }
685
680 return 0; 686 return 0;
681} 687}
682 688
@@ -716,6 +722,12 @@ int iscsit_ta_cache_dynamic_acls(
716 return -EINVAL; 722 return -EINVAL;
717 } 723 }
718 724
725 if (a->generate_node_acls == 1 && flag == 0) {
726 pr_debug("Skipping cache_dynamic_acls=0 when"
727 " generate_node_acls=1\n");
728 return 0;
729 }
730
719 a->cache_dynamic_acls = flag; 731 a->cache_dynamic_acls = flag;
720 pr_debug("iSCSI_TPG[%hu] - Cache Dynamic Initiator Portal Group" 732 pr_debug("iSCSI_TPG[%hu] - Cache Dynamic Initiator Portal Group"
721 " ACLs %s\n", tpg->tpgt, (a->cache_dynamic_acls) ? 733 " ACLs %s\n", tpg->tpgt, (a->cache_dynamic_acls) ?