[Ocfs2-commits] zab commits r2506 - in
branches/endian-safe/fs/ocfs2: . dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Aug 11 20:13:14 CDT 2005
Author: zab
Date: 2005-08-11 20:13:12 -0500 (Thu, 11 Aug 2005)
New Revision: 2506
Modified:
branches/endian-safe/fs/ocfs2/dlm/userdlm.c
branches/endian-safe/fs/ocfs2/dlmglue.c
branches/endian-safe/fs/ocfs2/super.c
Log:
o make sure to consistently calculate the net keys across between endians
Modified: branches/endian-safe/fs/ocfs2/dlm/userdlm.c
===================================================================
--- branches/endian-safe/fs/ocfs2/dlm/userdlm.c 2005-08-12 00:22:04 UTC (rev 2505)
+++ branches/endian-safe/fs/ocfs2/dlm/userdlm.c 2005-08-12 01:13:12 UTC (rev 2506)
@@ -640,7 +640,7 @@
return ERR_PTR(-ENOMEM);
}
- dlm_key = crc32(0, name->name, name->len);
+ dlm_key = crc32_be(0, name->name, name->len);
snprintf(domain, name->len + 1, "%.*s", name->len, name->name);
Modified: branches/endian-safe/fs/ocfs2/dlmglue.c
===================================================================
--- branches/endian-safe/fs/ocfs2/dlmglue.c 2005-08-12 00:22:04 UTC (rev 2505)
+++ branches/endian-safe/fs/ocfs2/dlmglue.c 2005-08-12 01:13:12 UTC (rev 2506)
@@ -1798,7 +1798,7 @@
/* used by the dlm code to make message headers unique, each
* node in this domain must agree on this. */
- dlm_key = crc32(0, osb->uuid_str, strlen(osb->uuid_str));
+ dlm_key = crc32_be(0, osb->uuid_str, strlen(osb->uuid_str));
/* for now, uuid == domain */
dlm = dlm_register_domain(osb->uuid_str, dlm_key);
Modified: branches/endian-safe/fs/ocfs2/super.c
===================================================================
--- branches/endian-safe/fs/ocfs2/super.c 2005-08-12 00:22:04 UTC (rev 2505)
+++ branches/endian-safe/fs/ocfs2/super.c 2005-08-12 01:13:12 UTC (rev 2506)
@@ -37,6 +37,7 @@
#include <linux/socket.h>
#include <linux/inet.h>
#include <linux/parser.h>
+#include <linux/crc32.h>
#include <cluster/nodemanager.h>
@@ -1258,8 +1259,10 @@
status = -ENOMEM;
goto bail;
}
- memcpy(&osb->net_key, &osb->uuid[i], sizeof(osb->net_key));
+ /* only checksuming the first 32 bits to differentiate from dlm */
+ osb->net_key = crc32_be(0, osb->uuid_str, sizeof(osb->net_key));
+
strncpy(osb->vol_label, di->id2.i_super.s_label, 63);
osb->vol_label[63] = '\0';
osb->root_blkno = le64_to_cpu(di->id2.i_super.s_root_blkno);
More information about the Ocfs2-commits
mailing list