From: Geoff Levand <geoffrey.levand@am.sony.com>
To: Simon Horman <horms@verge.net.au>
Cc: kexec@lists.infradead.org,
Cell Broadband Engine OSS Development <cbe-oss-dev@ozlabs.org>
Subject: [patch kexec] Fix test for loaded kernel
Date: Fri, 12 Sep 2008 12:08:23 -0700 [thread overview]
Message-ID: <48CABE27.10301@am.sony.com> (raw)
Fix these reboot errors with NFS mounted root filesystems:
nfs: server 192.168.1.1 not responding, still trying
The main kexec code that uses kexec_loaded() expects a non-zero
return to mean a kexec kernel has been loaded for execution.
Here is the current check:
if ((result == 0) && (do_shutdown || do_exec) && !kexec_loaded())
die
In cases where the currently running kernel does not have kexec enabled,
or in cases where the distro init scripts (YDL, maybe others) have unmounted
the sys filesystem prior to running kexec, the open of
"/sys/kernel/kexec_loaded" will fail. This result should be returned as
(0), meaning NOT LOADED. The current kexec_loaded() code returns (-1),
meaning LOADED.
With the current code, kexec will continue on. The next steps are to
shutdown the network, then call sys_kexec. The shutdown of the network
will succeed, but the call to sys_kexec will fail. In this case, control
will pass back to the init scripts, but the network will be down.
Systems with NFS mounted root filesystem cannot work in this state.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
kexec/kexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -805,7 +805,7 @@ static int kexec_loaded(void)
fp = fopen("/sys/kernel/kexec_loaded", "r");
if (fp == NULL)
- return -1;
+ return 0;
fscanf(fp, "%d", &ret);
fclose(fp);
return ret;
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next reply other threads:[~2008-09-12 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-12 19:08 Geoff Levand [this message]
2008-09-12 19:33 ` [patch kexec] Fix test for loaded kernel Geoff Levand
2008-09-15 6:18 ` Mohan Kumar M
2008-09-15 7:03 ` Simon Horman
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=48CABE27.10301@am.sony.com \
--to=geoffrey.levand@am.sony.com \
--cc=cbe-oss-dev@ozlabs.org \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.