From a02163494e4ae3c0deb6a0c66c7736e43e19733f Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 10 Sep 2016 20:36:37 +1000 Subject: [PATCH] hung_task-allow-hung_task_panic-when-hung_task_warnings-is-0-fix fix off-by-one Cc: John Siddle Cc: Tetsuo Handa Signed-off-by: Andrew Morton --- kernel/hung_task.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index dbf58050f3fa..2b59c82cc3e1 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -101,14 +101,12 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout) if (!sysctl_hung_task_warnings && !sysctl_hung_task_panic) return; - if (sysctl_hung_task_warnings > 0) - sysctl_hung_task_warnings--; - /* * Ok, the task did not get scheduled for more than 2 minutes, * complain: */ if (sysctl_hung_task_warnings) { + sysctl_hung_task_warnings--; pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n", t->comm, t->pid, timeout); pr_err(" %s %s %.*s\n", -- 2.34.1