Skip to contentSkip to conversation

Fix sysrq/panic for gcc 3.1

PATCH New Andi Kleen 1 participant 1 message Apr 20, 2002

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Fix sysrq/panic for gcc 3.1

Without this patch a loop checking for emergency_sync_scheduled in panic() is optimized away by gcc 3.1, which causes hangs in panic.

-Andi

drivers/char/sysrq.c renamed from ../v2.5/linux/drivers/char/sysrq.c +1 -1
diff -X ../../KDIFX -x *-o -x *-RESERVE -burpN ../../v2.5/linux/drivers/char/sysrq.c linux/drivers/char/sysrq.c
@@ -186,7 +186,7 @@ static void go_sync(struct super_block *
  * block devices and malfunctional network filesystems.
  */
 
-int emergency_sync_scheduled;
+volatile int emergency_sync_scheduled;
 
 void do_emergency_sync(void) {
 	struct super_block *sb;
include/linux/sysrq.h renamed from ../v2.5/linux/include/linux/sysrq.h +1 -1
diff -X ../../KDIFX -x *-o -x *-RESERVE -burpN ../../v2.5/linux/include/linux/sysrq.h linux/include/linux/sysrq.h
@@ -103,7 +103,7 @@ static inline int __reterr(void)
 
 /* Deferred actions */
 
-extern int emergency_sync_scheduled;
+extern volatile int emergency_sync_scheduled;
 
 #define EMERG_SYNC 1
 #define EMERG_REMOUNT 2