Hi Zoran/Hung, I missed thinking for multi-valued and multi NO-DANGLING, attributes. will re-publish the patch again.
/Neel. On Wednesday 18 November 2015 03:56 PM, Zoran Milinkovic wrote: > > Hi Neelakanta, > > Agree with Hung’s comments. > > In an object, there can be more attributes with no-dangling flags, or > multi-value attribute with no-dangling flag. Multi-value attribute can > also have multiple object DNs. > > Then this solution will not work correct. > > BR, > > Zoran > > *From:*Hung Nguyen [mailto:[email protected]] > *Sent:* Wednesday, November 18, 2015 10:38 AM > *To:* [email protected]; Zoran Milinkovic > *Cc:* [email protected] > *Subject:* Re: [PATCH 1 of 1] imm:Allow deletion of dangling ref > object, when the object is modified by clearing NO_DANGLING attribute > in same CCB [#1599] > > Hi Neel, > > Please see my comments inline. > > BR, > Hung Nguyen - DEK Technologies > > -------------------------------------------------------------------------------- > From: Neelakanta [email protected] > <mailto:[email protected]> > Sent: Wednesday, November 18, 2015 4:17PM > To: Zoran Milinkovic, Hung Nguyen > [email protected] > <mailto:[email protected]>,[email protected] > <mailto:[email protected]> > Cc: Opensaf-devel > [email protected] > <mailto:[email protected]> > Subject: [PATCH 1 of 1] imm:Allow deletion of dangling ref object, when the > object is modified by clearing NO_DANGLING attribute in same CCB [#1599] > > > osaf/services/saf/immsv/immnd/ImmModel.cc | 20 ++++++++++++++++++++ > 1 files changed, 20 insertions(+), 0 deletions(-) > > > If the NO_DANGLING reference is modified(removed) in the same CCB, > then deletion of the NO_DANGLING object can be allowed because, we > are in apply and the CCBcommit will modify sReverseRefsNoDanglingMMap. > > diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc > b/osaf/services/saf/immsv/immnd/ImmModel.cc > --- a/osaf/services/saf/immsv/immnd/ImmModel.cc > +++ b/osaf/services/saf/immsv/immnd/ImmModel.cc > @@ -5050,6 +5050,26 @@ bool ImmModel::validateNoDanglingRefsDel > if(!(ommi->second->mObjFlags & IMM_DELETE_LOCK)) { > std::string objName; > getObjectName(ommi->second, objName); > + if(ommi->second->mObjFlags & IMM_NO_DANGLING_FLAG){ // > IMM_NO_DANGLING_FLAG will be set in CcbModify > + /* If the NO_DANGLING reference is modified(removed) in the > same CCB, > + then deletion of the NO_DANGLING object can be allowed > because, we are in apply > + and the CCBcommit will modify sReverseRefsNoDanglingMMap*/ > + ObjectMutationMap::iterator omit = > ccb->mMutations.find(objName); > + if(omit != ccb->mMutations.end()){ > + ObjectInfo * afim = omit->second->mAfterImage; > + AttrMap::iterator amit; > + for(amit=afim->mClassInfo->mAttrMap.begin(); > amit!=afim->mClassInfo->mAttrMap.end(); ++amit){ > + if(amit->second->mFlags & SA_IMM_ATTR_NO_DANGLING){ > + break; > + } > + } > [Hung] This only gets the first no-dangling attribute we found in mAttrMap. > Shouldn't other no-dangling attributes be checked also? > > + ImmAttrValueMap::iterator afim_amit = > afim->mAttrValueMap.find(amit->first.c_str()); > + if(afim_amit->second->empty()){ //CcbModify operation > cleared the NO_DANGLING attribute value. > + break; > + } > [Hung] If the attribute has no-dangling ref to other objects (not the one to > be deleted), we should allow that case too. > The 'empty' requirement is too strict here. > Also the multi-value attribute case is not covered. > > --- > > I think it's better to use collectNoDanglingRefs() here. > > ObjectNameSet afimNDRefs; > collectNoDanglingRefs(afim, afimNDRefs); > > Then we just simply check if 'omi->first' is in the 'afimNDRefs'. > > afimNDRefs.find(omi->first) == afimNDRefs.end() > > > + } > + } > + > LOG_WA("ERR_FAILED_OPERATION: Delete of object %s would violate > NO_DANGLING reference " > "from object %s, not scheduled for delete by this > Ccb:%u", > omit->first.c_str(), objName.c_str(), ccb->mId); > ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
