From: Andi Kleen <ak@muc.de>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix sysrq/panic for gcc 3.1
Date: Sat, 20 Apr 2002 18:33:23 +0200 [thread overview]
Message-ID: <20020420183323.A22383@averell> (raw)
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
diff -X ../../KDIFX -x *-o -x *-RESERVE -burpN ../../v2.5/linux/drivers/char/sysrq.c linux/drivers/char/sysrq.c
--- ../../v2.5/linux/drivers/char/sysrq.c Thu Mar 28 10:06:16 2002
+++ linux/drivers/char/sysrq.c Fri Apr 12 18:32:46 2002
@@ -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;
diff -X ../../KDIFX -x *-o -x *-RESERVE -burpN ../../v2.5/linux/include/linux/sysrq.h linux/include/linux/sysrq.h
--- ../../v2.5/linux/include/linux/sysrq.h Wed Apr 17 13:33:34 2002
+++ linux/include/linux/sysrq.h Sat Apr 20 16:12:00 2002
@@ -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
reply other threads:[~2002-04-20 17:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020420183323.A22383@averell \
--to=ak@muc.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox