[Bugs] [Bug 1672480] Bugs Test Module tests failing on s390x

bugzilla at redhat.com bugzilla at redhat.com
Mon Feb 11 09:36:55 UTC 2019


https://bugzilla.redhat.com/show_bug.cgi?id=1672480



--- Comment #8 from abhays <abhaysingh1722 at yahoo.in> ---
(In reply to Nithya Balachandran from comment #5)
> (In reply to abhays from comment #4)
> > Thanks for the reply.
> > 
> > Agreed @Nithya.
> > The setup used by the clients are having same "endianness"(Big Endian).
> > However, certain test cases fail on our Big Endian Systems which is our
> > major concern.
> 
> I think that is because the tests in  question are assuming that the files
> will exist on a certain brick based on the results we got while running them
> on out little-endian systems. As the hash values are different on big-endian
> systems, thos assumptions no longer hold.
> 
> Do you have a list of all the tests that are failing and where they fail? I
> can check to see if that is the case.

@Nithya,The above test cases(except
./tests/bitrot/bug-1207627-bitrot-scrub-status.t) pass on big endian systems
with the following change in "libglusterfs/src/hashfn.c":-
diff --git a/libglusterfs/src/hashfn.c b/libglusterfs/src/hashfn.c
index 62f7ab878..4e18144b8 100644
--- a/libglusterfs/src/hashfn.c
+++ b/libglusterfs/src/hashfn.c
@@ -10,7 +10,7 @@

#include <stdint.h>
#include <stdlib.h>
-
+#include <endian.h>
#include "hashfn.h"

#define get16bits(d) (*((const uint16_t *) (d)))
@@ -45,7 +45,6 @@ uint32_t SuperFastHash (const char * data, int32_t len) {

         rem = len & 3;
         len >>= 2;
-
         /* Main loop */
         for (;len > 0; len--) {
                 hash  += get16bits (data);
@@ -151,8 +150,9 @@ gf_dm_hashfn (const char *msg, int len)

         for (i = 0; i < full_quads; i++) {
                 for (j = 0; j < 4; j++) {
-                        word     = *intmsg;
-                        array[j] = word;
+                        //word     = *intmsg;
+                        word     = htole32(*intmsg);
+                       array[j] = word;
                         intmsg++;
                         full_words--;
                         full_bytes -= 4;
@@ -162,8 +162,9 @@ gf_dm_hashfn (const char *msg, int len)

         for (j = 0; j < 4; j++) {
                 if (full_words) {
-                        word     = *intmsg;
-                        array[j] = word;
+                        //word     = *intmsg;
+                        word     = htole32(*intmsg);
+                       array[j] = word;
                         intmsg++;
                         full_words--;
                         full_bytes -= 4;

This confirms that test cases were failing due to different hash value
calculations on both the systems(little and big endian). Please, let us know
when you have looked into the failures and got a fix.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list