diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2011-01-28 11:00:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-17 14:47:22 -0800 |
commit | 615563d11619a5df5c95577236888434c78e54a9 (patch) | |
tree | fe71978a5edce60839b5fd6b89d3a687ec9e0f53 /kernel | |
parent | 9b65e47537df40b66fdb50e17c3c50cc121c6254 (diff) |
watchdog: Fix sysctl consistency
commit 397357666de6b5b6adb5fa99f9758ec8cf30ac34 upstream.
If it was not possible to enable watchdog for any cpu, switch
watchdog_enabled back to 0, because it's visible via
kernel.watchdog sysctl.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1296230433-6261-2-git-send-email-dzickus@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/watchdog.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index e7f81f8bc43e..93e61c55b7fa 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -441,9 +441,6 @@ static int watchdog_enable(int cpu) wake_up_process(p); } - /* if any cpu succeeds, watchdog is considered enabled for the system */ - watchdog_enabled = 1; - return 0; } @@ -471,12 +468,16 @@ static void watchdog_disable(int cpu) static void watchdog_enable_all_cpus(void) { int cpu; - int result = 0; + + watchdog_enabled = 0; for_each_online_cpu(cpu) - result += watchdog_enable(cpu); + if (!watchdog_enable(cpu)) + /* if any cpu succeeds, watchdog is considered + enabled for the system */ + watchdog_enabled = 1; - if (result) + if (!watchdog_enabled) printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n"); } |