Hi Neelakanta,
Reviewed and tested the patch.
Ack with a minor comment on the performance. No need to send the code to
another review.
In the line line ....
if(ommi->second->mObjFlags & IMM_NO_DANGLING_FLAG){ //
IMM_NO_DANGLING_FLAG will be set in CcbModify
... another check can be added ....
if((ommi->second->mObjFlags & IMM_NO_DANGLING_FLAG)
&& (omi->second->mCcbId == ommi->second->mCcbId)){ //
IMM_NO_DANGLING_FLAG will be set in CcbModify
With this 'if' check, only objects with the same CCB ID will be checked.
Best regards,
Zoran
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, November 18, 2015 2:29 PM
To: Hung Nguyen D; Zoran Milinkovic
Cc: [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 | 18 ++++++++++++++++++
1 files changed, 18 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,24 @@ 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;
+ ObjectNameSet afimRefs;
+ ObjectNameSet::iterator it;
+ collectNoDanglingRefs(afim, afimRefs);
+ if(afimRefs.find(omit->first.c_str()) == afimRefs.end()){
+ TRACE("Delete of object %s is removed from NO_DANGLING
reference in the same Ccb%u"
+ "from object %s", omit->first.c_str(),
ccb->mId, objName.c_str());
+ break;
+ }
+ }
+ }
+
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