]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.4/watchdog-fix-sysctl-consistency.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.4 / watchdog-fix-sysctl-consistency.patch
1 From 397357666de6b5b6adb5fa99f9758ec8cf30ac34 Mon Sep 17 00:00:00 2001
2 From: Marcin Slusarz <marcin.slusarz@gmail.com>
3 Date: Fri, 28 Jan 2011 11:00:32 -0500
4 Subject: watchdog: Fix sysctl consistency
5
6 From: Marcin Slusarz <marcin.slusarz@gmail.com>
7
8 commit 397357666de6b5b6adb5fa99f9758ec8cf30ac34 upstream.
9
10 If it was not possible to enable watchdog for any cpu, switch
11 watchdog_enabled back to 0, because it's visible via
12 kernel.watchdog sysctl.
13
14 Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
15 Signed-off-by: Don Zickus <dzickus@redhat.com>
16 Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
17 Cc: Frederic Weisbecker <fweisbec@gmail.com>
18 LKML-Reference: <1296230433-6261-2-git-send-email-dzickus@redhat.com>
19 Signed-off-by: Ingo Molnar <mingo@elte.hu>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21
22 ---
23 kernel/watchdog.c | 13 +++++++------
24 1 file changed, 7 insertions(+), 6 deletions(-)
25
26 --- a/kernel/watchdog.c
27 +++ b/kernel/watchdog.c
28 @@ -441,9 +441,6 @@ static int watchdog_enable(int cpu)
29 wake_up_process(p);
30 }
31
32 - /* if any cpu succeeds, watchdog is considered enabled for the system */
33 - watchdog_enabled = 1;
34 -
35 return 0;
36 }
37
38 @@ -471,12 +468,16 @@ static void watchdog_disable(int cpu)
39 static void watchdog_enable_all_cpus(void)
40 {
41 int cpu;
42 - int result = 0;
43 +
44 + watchdog_enabled = 0;
45
46 for_each_online_cpu(cpu)
47 - result += watchdog_enable(cpu);
48 + if (!watchdog_enable(cpu))
49 + /* if any cpu succeeds, watchdog is considered
50 + enabled for the system */
51 + watchdog_enabled = 1;
52
53 - if (result)
54 + if (!watchdog_enabled)
55 printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n");
56
57 }