Thread (2 messages) flat view 2 messages, 2 authors, 2004-03-29

Re: md raid oops on 2.4.25/alpha

From: Ivan Kokshaysky <hidden>
Date: 2004-03-28 18:30:49
Also in: lkml

On Sun, Mar 28, 2004 at 07:30:22PM +0200, Thomas Steudten wrote:
Looks like the well known bad assembler code with gcc.
On the alpha you see the problem first in the
raid1_read_balance() code sequence..
Very likely.
You should use gcc 3.3.2 better 3.3.3.
Also, here is a hack (originally from Jay Estabrook) which
should work around a bug in older compilers.

Ivan.
--- linux.orig/drivers/md/raid1.c	Thu Feb  5 14:11:04 2004
+++ linux/drivers/md/raid1.c	Sun Mar 28 22:13:33 2004
@@ -487,6 +487,12 @@ static int raid1_read_balance (raid1_con
 		goto rb_out;
 	
 
+#if defined(CONFIG_ALPHA) && ((__GNUC__ < 3) || \
+			      ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)))
+	/* Work around a compiler bug in older gcc */
+	new_disk = *(volatile int *)&new_disk;
+#endif
+
 	/* make sure that disk is operational */
 	while( !conf->mirrors[new_disk].operational) {
 		if (new_disk <= 0) new_disk = conf->raid_disks;
@@ -544,6 +550,11 @@ static int raid1_read_balance (raid1_con
 	
 	/* Find the disk which is closest */
 	
+#if defined(CONFIG_ALPHA) && ((__GNUC__ < 3) || \
+			      ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)))
+	/* Work around a compiler bug in older gcc */
+	disk = *(volatile int *)&disk;
+#endif
 	do {
 		if (disk <= 0)
 			disk = conf->raid_disks;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help