On Fri, 2013-07-19 at 11:05 -0700, Andy Grover wrote: > Changing this attribute to 0 will mean that all initiators that login > to the target while the target has generate_node_acls=1 will see all > TPG LUNs, which may be the desired behavior in some cases. > Exposing demo_mode_login_only as a tcm_qla2xxx TPG attribute, and keeping it set to enabled by default should be enough to keep the broken FC clients happy, but still allow people to disable it when it's safe to enable real TPG demo-mode access. So that said, I'll be applying this for v3.12. --nab > Reported-by: Craig Watson <craig.watson@xxxxxxxxxxxxxxxxxxx> > Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> > --- > drivers/scsi/qla2xxx/tcm_qla2xxx.c | 21 +++++++++++++++++++-- > drivers/scsi/qla2xxx/tcm_qla2xxx.h | 1 + > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > index 75caa39..a97cff0 100644 > --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c > +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > @@ -360,6 +360,14 @@ static int tcm_qla2xxx_check_prod_write_protect(struct se_portal_group *se_tpg) > return QLA_TPG_ATTRIB(tpg)->prod_mode_write_protect; > } > > +static int tcm_qla2xxx_check_demo_mode_login_only(struct se_portal_group *se_tpg) > +{ > + struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, > + struct tcm_qla2xxx_tpg, se_tpg); > + > + return QLA_TPG_ATTRIB(tpg)->demo_mode_login_only; > +} > + > static struct se_node_acl *tcm_qla2xxx_alloc_fabric_acl( > struct se_portal_group *se_tpg) > { > @@ -935,11 +943,19 @@ DEF_QLA_TPG_ATTR_BOOL(prod_mode_write_protect); > DEF_QLA_TPG_ATTRIB(prod_mode_write_protect); > QLA_TPG_ATTR(prod_mode_write_protect, S_IRUGO | S_IWUSR); > > +/* > + * Define tcm_qla2xxx_tpg_attrib_s_demo_mode_login_only > + */ > +DEF_QLA_TPG_ATTR_BOOL(demo_mode_login_only); > +DEF_QLA_TPG_ATTRIB(demo_mode_login_only); > +QLA_TPG_ATTR(demo_mode_login_only, S_IRUGO | S_IWUSR); > + > static struct configfs_attribute *tcm_qla2xxx_tpg_attrib_attrs[] = { > &tcm_qla2xxx_tpg_attrib_generate_node_acls.attr, > &tcm_qla2xxx_tpg_attrib_cache_dynamic_acls.attr, > &tcm_qla2xxx_tpg_attrib_demo_mode_write_protect.attr, > &tcm_qla2xxx_tpg_attrib_prod_mode_write_protect.attr, > + &tcm_qla2xxx_tpg_attrib_demo_mode_login_only.attr, > NULL, > }; > > @@ -1038,6 +1054,7 @@ static struct se_portal_group *tcm_qla2xxx_make_tpg( > QLA_TPG_ATTRIB(tpg)->generate_node_acls = 1; > QLA_TPG_ATTRIB(tpg)->demo_mode_write_protect = 1; > QLA_TPG_ATTRIB(tpg)->cache_dynamic_acls = 1; > + QLA_TPG_ATTRIB(tpg)->demo_mode_login_only = 1; > > ret = core_tpg_register(&tcm_qla2xxx_fabric_configfs->tf_ops, wwn, > &tpg->se_tpg, tpg, TRANSPORT_TPG_TYPE_NORMAL); > @@ -1736,7 +1753,7 @@ static struct target_core_fabric_ops tcm_qla2xxx_ops = { > tcm_qla2xxx_check_demo_write_protect, > .tpg_check_prod_mode_write_protect = > tcm_qla2xxx_check_prod_write_protect, > - .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_true, > + .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only, > .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, > .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, > .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, > @@ -1784,7 +1801,7 @@ static struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { > .tpg_check_demo_mode_cache = tcm_qla2xxx_check_true, > .tpg_check_demo_mode_write_protect = tcm_qla2xxx_check_true, > .tpg_check_prod_mode_write_protect = tcm_qla2xxx_check_false, > - .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_true, > + .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only, > .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, > .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, > .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, > diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.h b/drivers/scsi/qla2xxx/tcm_qla2xxx.h > index 9ba075f..3293275 100644 > --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.h > +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.h > @@ -29,6 +29,7 @@ struct tcm_qla2xxx_tpg_attrib { > int cache_dynamic_acls; > int demo_mode_write_protect; > int prod_mode_write_protect; > + int demo_mode_login_only; > }; > > struct tcm_qla2xxx_tpg { -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html