From: Robert W. <wrw...@us...> - 2006-12-19 20:34:44
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5378/src Modified Files: iSNSdereg.c iSNSparse.c iSNSreg.c Log Message: Fix deregister to use attr not keys Index: iSNSparse.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSparse.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** iSNSparse.c 18 Dec 2006 23:00:05 -0000 1.16 --- iSNSparse.c 19 Dec 2006 20:34:38 -0000 1.17 *************** *** 97,100 **** --- 97,101 ---- case ISNS_ENTITY_GET_NXT_PORTAL_REQ: case ISNS_DEV_ATTR_QRY_RES: + case ISNS_DEREG_DEV_RES: parse_status = ISNSProfileKeysAttr (msg, attr_index, &num_attrs, key_index, &num_keys, (ISNS_Attr **)src_attr); Index: iSNSreg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSreg.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** iSNSreg.c 18 Dec 2006 23:00:05 -0000 1.17 --- iSNSreg.c 19 Dec 2006 20:34:38 -0000 1.18 *************** *** 1630,1634 **** new_member.node_idx = p_node->iscsi_index; } ! new_member.type = type; new_member.status = status; --- 1630,1635 ---- new_member.node_idx = p_node->iscsi_index; } ! ! DEBUG_1 (isns_reg_debug &1, Add_DD_Member member.type:%i,type); new_member.type = type; new_member.status = status; Index: iSNSdereg.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdereg.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** iSNSdereg.c 18 Dec 2006 23:00:05 -0000 1.17 --- iSNSdereg.c 19 Dec 2006 20:34:38 -0000 1.18 *************** *** 107,113 **** deregPortalFlag = FALSE; ! for (i = 0; i < MAX_PARSE_ATTRS && key_indx[i]; i++) { ! p_attr = (ISNS_Attr *)(key_indx[i]); switch (p_attr->tag) { --- 107,113 ---- deregPortalFlag = FALSE; ! for (i = 0; i < MAX_PARSE_ATTRS && attr_indx[i]; i++) { ! p_attr = (ISNS_Attr *)(attr_indx[i]); switch (p_attr->tag) { *************** *** 127,131 **** case ISNS_PORTAL_PORT: case ISNS_PORTAL_SYM_NAME: - // case ISNS_PORTAL_GROUP: deregPortalFlag = TRUE; break; --- 127,130 ---- *************** *** 168,180 **** status = ISNS_NO_ERR; if (deregEnitityFlag) ! status = SNSdbRemoveAttrEntity (key_indx, (ISNS_Attr *)src_attr, p_md, &p_rspMd->msg); if (deregPortalFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrPortal (key_indx, src_attr, p_md, &p_rspMd->msg); if (deregFCNodeFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrNode (key_indx, (char *)src_attr, p_md, &p_rspMd->msg); if (deregFCPortFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrPort (key_indx, src_attr, p_md, &p_rspMd->msg); if (deregISCSIFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrISCSI (key_indx, (char *)src_attr, p_md, &p_rspMd->msg); if (status == ISNS_NO_ERR) --- 167,179 ---- status = ISNS_NO_ERR; if (deregEnitityFlag) ! status = SNSdbRemoveAttrEntity (attr_indx, (ISNS_Attr *)src_attr, p_md, &p_rspMd->msg); if (deregPortalFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrPortal (attr_indx, src_attr, p_md, &p_rspMd->msg); if (deregFCNodeFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrNode (attr_indx, (char *)src_attr, p_md, &p_rspMd->msg); if (deregFCPortFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrPort (attr_indx, src_attr, p_md, &p_rspMd->msg); if (deregISCSIFlag && status == ISNS_NO_ERR) ! status = SNSdbRemoveAttrISCSI (attr_indx, (char *)src_attr, p_md, &p_rspMd->msg); if (status == ISNS_NO_ERR) *************** *** 836,839 **** --- 835,840 ---- + DEBUG_0 (isns_dereg_debug &1, SSNSdbRemoveAttrPortal); + foundFlag = FALSE; saveIndex = 0; *************** *** 1052,1056 **** ISNS_DBKey remove_key; ! DEBUG_0 (isns_dereg_debug & 1, (Deregistering iSCSI Node)); scn_bitmap = 0; --- 1053,1057 ---- ISNS_DBKey remove_key; ! DEBUG_1 (isns_dereg_debug & 1, (Deregistering iSCSI Node:%s),iscsi_node_key); scn_bitmap = 0; *************** *** 1088,1104 **** p_dd = (SOIP_Dd *)&entry5.data; - /* - if (ISNS_NO_ERR != Remove_DD_ISCSI_Member(p_dd, p_node->id.v)) - return (ISNS_UNKNOWN_ERR); - */ /* Send SCN */ send_iscsi_scn_on_dd_mem_change (p_node, NULL, p_dd, 0, ISNS_SCN_OBJ_REMOVED); ! ! if (ISNS_NO_ERR != ! Disable_DD_Member (p_dd, p_node->id.v, ISNS_DD_ISCSI_MEMBER)) ! return (ISNS_UNKNOWN_ERR); ! ! /* Send SCN All */ /* Prepare the SCN */ --- 1089,1096 ---- p_dd = (SOIP_Dd *)&entry5.data; /* Send SCN */ send_iscsi_scn_on_dd_mem_change (p_node, NULL, p_dd, 0, ISNS_SCN_OBJ_REMOVED); ! Disable_DD_Member (p_dd, p_node->id.v, ISNS_DD_ISCSI_MEMBER); /* Prepare the SCN */ *************** *** 1726,1730 **** /********************************************************************* _Disable_DD_Member - Disables a DD member. This gets called when a node is deleted. *********************************************************************/ --- 1718,1721 ---- *************** *** 1735,1738 **** --- 1726,1731 ---- SOIP_Dd_Member *p_member; + DEBUG_0 (isns_dereg_debug &1, Disable_DD_Member); + pnode=NULL; while ((pnode=GetNextNode(&p_dd->member_list, pnode))) *************** *** 1741,1753 **** --- 1734,1754 ---- if (p_member->type != type) + { + DEBUG_2 (isns_dereg_debug &1, p_member->type:%i not equal to type:%i,p_member->type,type); continue; + } if (p_member->type == ISNS_DD_ISCSI_MEMBER && 0 != strcmp (p_member->node_id, ptr)) + { + DEBUG_0 (isns_dereg_debug &1, p_member->type not equal to type); continue; + } if (p_member->type == ISNS_DD_IFCP_MEMBER && 0 != memcmp (p_member->node_id, ptr, ISNS_PORT_NAME_SIZE)) + { continue; + } /* Match found */ *************** *** 1755,1758 **** --- 1756,1761 ---- return (ISNS_NO_ERR); } + + DEBUG_0 (isns_dereg_debug &1, Disable_DD_Member return error); return (ERROR); } |