hung_task-allow-hung_task_panic-when-hung_task_warnings-is-0-fix
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 10 Sep 2016 10:36:37 +0000 (20:36 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Sep 2016 03:57:02 +0000 (13:57 +1000)
fix off-by-one

Cc: John Siddle <jsiddle@redhat.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/hung_task.c

index dbf58050f3fa0f62e0cc33272046593d611bb5de..2b59c82cc3e1bb0813088cf5e22307d81230e13e 100644 (file)
@@ -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",
This page took 0.025516 seconds and 5 git commands to generate.