From: Wang Sheng-Hui <shhuiw@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
"Suzuki K. Poulose" <suzuki@in.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] fadump: allow duplicate assignment to /sys/kernel/fadump_registered when it's assigned the desired value already
Date: Wed, 10 Apr 2013 08:46:28 +0800 [thread overview]
Message-ID: <5164B664.6070306@gmail.com> (raw)
When the fadump is enabled, we have /sys/kernel/fadump_enabled assigned 1.
But sometimes we need to restart the fadump service by 'service kdump restart',
in case the kdump script has added the fadump detect/support already.
In current implementation, we cannot re-assign 1 to /sys/kernel/fadump_enabled
if 1 is already set and we have added more logic check in the user space script.
I think we can enable the duplicate assignment to ease the user space tools,
as long as the value is the right 1 or 0.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
arch/powerpc/kernel/fadump.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 06c8202..e1347e5 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1140,18 +1140,14 @@ static ssize_t fadump_register_store(struct kobject *kobj,
switch (buf[0]) {
case '0':
- if (fw_dump.dump_registered == 0) {
- ret = -EINVAL;
+ if (fw_dump.dump_registered == 0)
goto unlock_out;
- }
/* Un-register Firmware-assisted dump */
fadump_unregister_dump(&fdm);
break;
case '1':
- if (fw_dump.dump_registered == 1) {
- ret = -EINVAL;
+ if (fw_dump.dump_registered == 1)
goto unlock_out;
- }
/* Register Firmware-assisted dump */
register_fadump();
break;
--
1.7.10.4
next reply other threads:[~2013-04-10 0:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 0:46 Wang Sheng-Hui [this message]
2013-04-10 1:43 ` [PATCH] fadump: allow duplicate assignment to /sys/kernel/fadump_registered when it's assigned the desired value already Mahesh Jagannath Salgaonkar
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=5164B664.6070306@gmail.com \
--to=shhuiw@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=suzuki@in.ibm.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 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.