Ack from me. -----Original Message----- From: Thien Minh Huynh <thien.m.hu...@dektech.com.au> Sent: Thursday, October 7, 2021 1:53 PM To: Thang Duc Nguyen <thang.d.ngu...@dektech.com.au>; Minh Hon Chau <minh.c...@dektech.com.au>; Thanh Nguyen <thanh.ngu...@dektech.com.au> Cc: opensaf-devel@lists.sourceforge.net; Thien Minh Huynh <thien.m.hu...@dektech.com.au> Subject: [PATCH 1/1] ntf: get attribute value from local when value not existed [#3289]
If create and modify attributes with SA_NOTIFY flag same object in one CCB, ntfimcn will receive SA_AIS_ERR_NOT_EXIST when get attribute value from modify callback. The fix is to get attribute value from local when value not existed. Because ntfimcn had been stored value from create callback before. --- src/ntf/ntfimcnd/ntfimcn_imm.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ntf/ntfimcnd/ntfimcn_imm.c b/src/ntf/ntfimcnd/ntfimcn_imm.c index 8d73fb35a..b36b18747 100644 --- a/src/ntf/ntfimcnd/ntfimcn_imm.c +++ b/src/ntf/ntfimcnd/ntfimcn_imm.c @@ -575,8 +575,20 @@ saImmOiCcbObjectModifyCallback(SaImmOiHandleT immOiHandle, SaImmOiCcbIdT ccbId, if (SA_AIS_OK == rc) { ccbOperData->userData = curAttr; } else { - ccbOperData->userData = NULL; - LOG_ER("Failed to get current attributes rc = %u", rc); + struct CcbUtilOperationData *ccbOperationData; + + ccbOperationData = + ccbutil_getCcbOpDataByDN(ccbId, objectName); + if (ccbOperationData != NULL && + ccbOperationData->operationType == CCBUTIL_CREATE) { + curAttr = + (SaImmAttrValuesT_2 **)ccbOperationData + ->param.create.attrValues; + ccbOperData->userData = curAttr; + } else { + ccbOperData->userData = NULL; + LOG_WA("Failed to get current attributes rc = %u", rc); + } } } -- 2.25.1 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel