With the new 'active' attribute, a bug exists where the attribute

value is not changed when the appropriate ALUA state is set, unless a
target session exists for the target group target; this patch fixes
that bug, see here for more information:
https://sourceforge.net/p/scst/mailman/message/35898014/

Signed-off-by: Marc A. Smith <marc.smith@parodyne.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7211 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2017-07-15 03:26:11 +00:00
parent c967700cd7
commit 792a896abb

View File

@@ -975,6 +975,10 @@ static void __scst_tg_set_state(struct scst_target_group *tg,
list_for_each_entry(dg_dev, &tg->dg->dev_list, entry) {
dev = dg_dev->dev;
dev_changed = false;
if ((dev->handler->on_alua_state_change_start != NULL) && !dev_changed) {
dev->handler->on_alua_state_change_start(dev, old_state, state);
dev_changed = true;
}
list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list,
dev_tgt_dev_list_entry) {
tgt = tgt_dev->sess->tgt;
@@ -982,11 +986,6 @@ static void __scst_tg_set_state(struct scst_target_group *tg,
if (tg_tgt->tgt == tgt) {
bool gen_ua = (state != SCST_TG_STATE_TRANSITIONING);
if ((dev->handler->on_alua_state_change_start != NULL) && !dev_changed) {
dev->handler->on_alua_state_change_start(dev, old_state, state);
dev_changed = true;
}
if ((tg->dg->stpg_rel_tgt_id == tgt_dev->sess->tgt->rel_tgt_id) &&
tid_equal(tg->dg->stpg_transport_id, tgt_dev->sess->transport_id))
gen_ua = false;