Ack

Regards, Vu

> -----Original Message-----
> From: Canh Van Truong [mailto:[email protected]]
> Sent: Tuesday, February 14, 2017 1:20 PM
> To: [email protected]; [email protected];
> [email protected]
> Cc: [email protected]
> Subject: [PATCH 1 of 1] ntf: workaround to fix failed upgrade [#2300]
> 
>  src/ntf/ntfd/NtfLogger.cc |  9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> 
> During cluster upgrade from an old OpenSAF version which have not included
> the
> fix #2006 to one that have the fix in, if there is an code fault related
to
> inconsistent in additionalText and lengthAdditionalText in NTF
application,
> could lead to upgadate failed.
> 
> This patch fix to add an workwround in NTFs, adjust lengthAdditionalText
to
> correct one if NTFs find the mismatch
> 
> Note: The patch applies on branch 5.0 has little differences. There are
some
> changes in test cases
> ntftest 30 3... to change the length of additionalText+1  and
> lengthAdditionalText are the same.
> 
> diff --git a/src/ntf/ntfd/NtfLogger.cc b/src/ntf/ntfd/NtfLogger.cc
> --- a/src/ntf/ntfd/NtfLogger.cc
> +++ b/src/ntf/ntfd/NtfLogger.cc
> @@ -197,6 +197,15 @@ SaAisErrorT NtfLogger::logNotification(N
> 
>    sendNotInfo = notif->getNotInfo();
>    ntfsv_get_ntf_header(sendNotInfo, &ntfHeader);
> +
> +  // Workaround to fix with failed upgrade
> +  // Auto correction if there is inconsistent b/w lengthAdditionalText
and
> additionalText
> +  if (ntfHeader->additionalText != NULL &&
> +      ntfHeader->lengthAdditionalText > strlen(ntfHeader->additionalText)
+
> 1) {
> +    LOG_WA("Mismatch b/w lengthAdditionalText and additionalText. Re-
> Adjust!");
> +    ntfHeader->lengthAdditionalText = strlen(ntfHeader->additionalText) +
1;
> +  }
> +
>    logBuffer.logBufSize = ntfHeader->lengthAdditionalText;
>    logBuffer.logBuf = (SaUint8T*)&addTextBuf[0];
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to