Skip to contentSkip to conversation

DLM: Fix static buffer alignment

PATCH In review Fabio M. Di Nitto 3 participants 5 messages Jan 15, 2008 Distributed lock manager (DLM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DLM: Fix static buffer alignment

Hi Steven,

gcc does not guarantee that a static buffer is 64bit aligned. This change allows sparc64 to mount and use gfs2.

fs/dlm/midcomms.c +1 -1
index f8c69dd..da653b5 100644
@@ -58,7 +58,7 @@ static void copy_from_cb(void *dst, const void *base, unsigned offset,
  int dlm_process_incoming_buffer(int nodeid, const void *base,
  				unsigned offset, unsigned len, unsigned limit)
  {
-	unsigned char __tmp[DLM_INBUF_LEN];
+	unsigned char __tmp[DLM_INBUF_LEN] __attribute__((aligned(64)));
  	struct dlm_header *msg = (struct dlm_header *) __tmp;
  	int ret = 0;
  	int err = 0;

--
I'm going to make him an offer he can't refuse.

#1 lore raw

Hi,

There is something not quite right about this patch... it doesn't seem to apply and I suspect whitespace, but I can't see what the problem is at the moment,

Steve.

Quoted 24 lines · Fabio M. Di Nitto

Hi Steven,

gcc does not guarantee that a static buffer is 64bit aligned. This change allows sparc64 to mount and use gfs2.

fs/dlm/midcomms.c +1 -2
index f8c69dd..da653b5 100644
@@ -58,7 +58,7 @@ static void copy_from_cb(void *dst, const void *base, unsigned offset,
  int dlm_process_incoming_buffer(int nodeid, const void *base,
  				unsigned offset, unsigned len, unsigned limit)
  {
-	unsigned char __tmp[DLM_INBUF_LEN];
+	unsigned char __tmp[DLM_INBUF_LEN] __attribute__((aligned(64)));
  	struct dlm_header *msg = (struct dlm_header *) __tmp;
  	int ret = 0;
  	int err = 0;
 
 
--

I'm going to make him an offer he can't refuse.

#2 lore raw

Ok this is weird.. not the first time that this is happening between us.. tho i did change MUA that has a slightly more sane way of adding stuff... anyway I will prepare a git tree you can pull from..

at this point it will just save us pain for the future.

Thanks
Fabio

Quoted 31 lines · Steven Whitehouse

Hi,

There is something not quite right about this patch... it doesn't seem to apply and I suspect whitespace, but I can't see what the problem is at the moment,

Steve.

Quoted 22 lines · Fabio M. Di Nitto

Hi Steven,

gcc does not guarantee that a static buffer is 64bit aligned. This change allows sparc64 to mount and use gfs2.

fs/dlm/midcomms.c +1 -1
index f8c69dd..da653b5 100644
@@ -58,7 +58,7 @@ static void copy_from_cb(void *dst, const void *base, unsigned offset,
  int dlm_process_incoming_buffer(int nodeid, const void *base,
  				unsigned offset, unsigned len, unsigned limit)
  {
-	unsigned char __tmp[DLM_INBUF_LEN];
+	unsigned char __tmp[DLM_INBUF_LEN] __attribute__((aligned(64)));
  	struct dlm_header *msg = (struct dlm_header *) __tmp;
  	int ret = 0;
  	int err = 0;
Quoted 3 lines
Quoted 2 lines

--
I'm going to make him an offer he can't refuse.

--
I'm going to make him an offer he can't refuse.

#3 lore raw

Hi Steven,

you can try to pull from here:

git pull git://git.fugedabout.it/people/fabbione/gfs2-2.6-nmw.git

[DLM] Fix endian issue when transmitting or receiving LOCK_REPLY [DLM] align static buffer

gitweb: http://git.fugedabout.it/?p=people/fabbione/gfs2-2.6-nmw.git;a=summary

Let me know if there are any problems...

Cheers
Fabio

Quoted 45 lines · Fabio M. Di Nitto

Ok this is weird.. not the first time that this is happening between us.. tho i did change MUA that has a slightly more sane way of adding stuff... anyway I will prepare a git tree you can pull from..

at this point it will just save us pain for the future.

Thanks
Fabio

Quoted 33 lines · Steven Whitehouse

Hi,

There is something not quite right about this patch... it doesn't seem to apply and I suspect whitespace, but I can't see what the problem is at the moment,

Steve.

Quoted 24 lines · Fabio M. Di Nitto

Hi Steven,

gcc does not guarantee that a static buffer is 64bit aligned. This change allows sparc64 to mount and use gfs2.

fs/dlm/midcomms.c +1 -1
index f8c69dd..da653b5 100644
@@ -58,7 +58,7 @@ static void copy_from_cb(void *dst, const void *base, 
 unsigned offset,
  int dlm_process_incoming_buffer(int nodeid, const void *base,
  				unsigned offset, unsigned len, unsigned 
 limit)
  {
-	unsigned char __tmp[DLM_INBUF_LEN];
+	unsigned char __tmp[DLM_INBUF_LEN] __attribute__((aligned(64)));
  	struct dlm_header *msg = (struct dlm_header *) __tmp;
  	int ret = 0;
  	int err = 0;
Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

--
I'm going to make him an offer he can't refuse.

--
I'm going to make him an offer he can't refuse.

--
I'm going to make him an offer he can't refuse.

maintainer
#4 lore raw
Quoted 6 lines

Hi Steven,

you can try to pull from here:

git pull git://git.fugedabout.it/people/fabbione/gfs2-2.6-nmw.git

Quoted 7 lines

[DLM] Fix endian issue when transmitting or receiving LOCK_REPLY [DLM] align static buffer

gitweb:
http://git.fugedabout.it/?p=people/fabbione/gfs2-2.6-nmw.git;a=summary

Let me know if there are any problems...

I'm collecting all dlm patches for 2.6.25 here:

http://people.redhat.com/teigland/dlm-patches-testing/

It includes the dlm patches already in the gfs2nmw git tree, plus the new patches you've sent the past couple days. I'm working on getting them into my own public git tree. If that doesn't happen soon enough for 2.6.25 I'll send the lot to Steve.