From: Andrew Morton Date: Sat, 10 Sep 2016 10:36:37 +0000 (+1000) Subject: hung_task-allow-hung_task_panic-when-hung_task_warnings-is-0-fix X-Git-Url: http://git.efficios.com/?p=deliverable%2Flinux.git;a=commitdiff_plain;h=a02163494e4ae3c0deb6a0c66c7736e43e19733f 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 --- 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",