changeset 12951:21b9be7f3041

6936691 Unable to discover existing or new targets after an upgrade or appliance reboot
author Priya Krishnan <Priya.Krishnan@Sun.COM>
date Wed, 28 Jul 2010 15:51:36 -0400
parents d560524b6bb6
children 982975ba6eba
files usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c	Wed Jul 28 12:45:59 2010 -0700
+++ b/usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c	Wed Jul 28 15:51:36 2010 -0400
@@ -1620,6 +1620,17 @@
 		if (it_portal_lookup(cfg_tpg, &portal->portal_addr) == NULL) {
 			avl_remove(&tpg->tpg_portal_list, portal);
 			iscsit_portal_delete(portal);
+			/*
+			 * If the last portal is deleted from the target
+			 * portal group, then the tpg->tpg_online count
+			 * must be decremented. The other two callers of
+			 * iscsit_portal_delete() destroy the target portal
+			 * after deleting the portal so it is not necessary
+			 * to decrement the tpg->tpg_online count.
+			 */
+			if (avl_is_empty(&tpg->tpg_portal_list)) {
+				tpg->tpg_online--;
+			}
 		}
 	}