Skip to content

Commit

Permalink
lib/fault-inject.c: use correct check for interrupts
Browse files Browse the repository at this point in the history
in_interrupt() also returns true when bh is disabled in task context.
That's not what fail_task() wants to check.  Use the new in_task()
predicate that does the right thing.

Link: http://lkml.kernel.org/r/20170321091805.140676-1-dvyukov@google.com
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
dvyukov authored and torvalds committed May 9, 2017
1 parent f61e869 commit f2ad37d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fault-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void fail_dump(struct fault_attr *attr)

static bool fail_task(struct fault_attr *attr, struct task_struct *task)
{
return !in_interrupt() && task->make_it_fail;
return in_task() && task->make_it_fail;
}

#define MAX_STACK_TRACE_DEPTH 32
Expand Down

0 comments on commit f2ad37d

Please sign in to comment.