Hi,

F.Y.I: #1315 was pushed. You now can test this patch. 

Regards, Vu

> -----Original Message-----
> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> Sent: Monday, July 25, 2016 9:59 AM
> To: 'minh chau' <minh.c...@dektech.com.au>; 'praveen malviya'
> <praveen.malv...@oracle.com>; 'Lennart Lund'
> <lennart.l...@ericsson.com>
> Cc: 'opensaf-devel@lists.sourceforge.net' <opensaf-
> de...@lists.sourceforge.net>
> Subject: RE: [PATCH 1 of 1] ntfsv: refactor logging long dn notification
> [#1585]
> 
> Hi Minh,
> 
> Yes.
> 
> By the way, I would attach patches of #1315 which was acked/tested by
> Mahesh just in case you want to test #1585 now.
> 
> Regards, Vu
> 
> > -----Original Message-----
> > From: minh chau [mailto:minh.c...@dektech.com.au]
> > Sent: Monday, July 25, 2016 8:24 AM
> > To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; praveen malviya
> > <praveen.malv...@oracle.com>; Lennart Lund
> > <lennart.l...@ericsson.com>
> > Cc: opensaf-devel@lists.sourceforge.net
> > Subject: Re: [PATCH 1 of 1] ntfsv: refactor logging long dn notification
> > [#1585]
> >
> > Hi Vu,
> >
> > The patch looks good. Can I test this patch after #1315 is pushed? I run
> > into osaf_abort() for now.
> >
> > Thanks,
> > Minh
> >
> > On 22/07/16 21:16, Vu Minh Nguyen wrote:
> > >   osaf/services/saf/ntfsv/ntfs/NtfLogger.cc |  51
+++++++-------------------
> --
> > --
> > >   1 files changed, 13 insertions(+), 38 deletions(-)
> > >
> > >
> > > Remove the part of code that truncates the long DN.
> > >
> > > diff --git a/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc
> > b/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc
> > > --- a/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc
> > > +++ b/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc
> > > @@ -21,6 +21,7 @@
> > >    */
> > >   #include <sys/poll.h>
> > >
> > > +#include "osaf_utility.h"
> > >   #include "saAis.h"
> > >   #include "saLog.h"
> > >   #include "NtfAdmin.hh"
> > > @@ -232,48 +233,22 @@ SaAisErrorT NtfLogger::logNotification(N
> > >                                      notif->getNotificationId(),
> > >                                      SA_LOG_RECORD_WRITE_ACK,
> > >                                      &logRecord);
> > > -    if (SA_AIS_OK != errorCode) {
> > > -      LOG_NO("Failed to log an alarm or security alarm notification
(%d)",
> > errorCode);
> > > -      if (errorCode == SA_AIS_ERR_LIBRARY || errorCode ==
> > SA_AIS_ERR_BAD_HANDLE) {
> > > -        LOG_ER("Fatal error SA_AIS_ERR_LIBRARY or
> > SA_AIS_ERR_BAD_HANDLE; exiting (%d)...", errorCode);
> > > -        exit(EXIT_FAILURE);
> > > -      } else if (errorCode == SA_AIS_ERR_INVALID_PARAM) {
> > > -        /* Retry to log truncated notificationObject/notifyingObject
> because
> > > -         * LOG Service has not supported long dn in Opensaf 4.5
> > > -         */
> > > -        char short_dn[SA_MAX_UNEXTENDED_NAME_LENGTH];
> > > -        memset(&short_dn, 0, SA_MAX_UNEXTENDED_NAME_LENGTH);
> > > -        SaNameT shortdn_notificationObject, shortdn_notifyingObject;
> > > -        if (osaf_is_an_extended_name(ntfHeader->notificationObject))
{
> > > -          strncpy(short_dn, osaf_extended_name_borrow(ntfHeader-
> > >notificationObject)
> > > -                  , SA_MAX_UNEXTENDED_NAME_LENGTH - 1);
> > > -          osaf_extended_name_lend(short_dn,
> &shortdn_notificationObject);
> > > -          logRecord.logHeader.ntfHdr.notificationObject =
> > &shortdn_notificationObject;
> > > -        }
> > > -        if (osaf_is_an_extended_name(ntfHeader->notifyingObject)) {
> > > -          strncpy(short_dn, osaf_extended_name_borrow(ntfHeader-
> > >notifyingObject)
> > > -                  , SA_MAX_UNEXTENDED_NAME_LENGTH - 1);
> > > -          osaf_extended_name_lend(short_dn,
&shortdn_notifyingObject);
> > > -          logRecord.logHeader.ntfHdr.notifyingObject =
> > &shortdn_notifyingObject;
> > > -        }
> > > -        if (short_dn[0] != '\0') {
> > > -          LOG_NO("Retry to log the truncated
> > notificationObject/notifyingObject");
> > > -          if ((errorCode = saLogWriteLogAsync(alarmStreamHandle,
> > > -
notif->getNotificationId(),
> > > -
SA_LOG_RECORD_WRITE_ACK,
> > > -                                              &logRecord)) !=
SA_AIS_OK) {
> > > -            LOG_ER("Failed to log the truncated
> > notificationObject/notifyingObject (%d)"
> > > -                   , errorCode);
> > > -          }
> > > -        }
> > > -      }
> > > -      goto end;
> > > +    switch (errorCode) {
> > > +    case SA_AIS_OK:
> > > +     break;
> > > +
> > > +    /* LOGsv is busy. Put the notification to queue and re-send next
time
> */
> > > +    case SA_AIS_ERR_TRY_AGAIN:
> > > +    case SA_AIS_ERR_TIMEOUT:
> > > +     TRACE("Failed to log notification (ret: %d). Try next time.",
> > errorCode);
> > > +     break;
> > > +
> > > +    default:
> > > +     osaf_abort(errorCode);
> > >       }
> > >     }
> > >
> > > -end:
> > >     TRACE_LEAVE();
> > > -
> > >     return errorCode;
> > >   }
> > >
> > >



------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to