提交 f2ad37da 编写于 作者: D Dmitry Vyukov 提交者: Linus Torvalds

lib/fault-inject.c: use correct check for interrupts

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.comSigned-off-by: NDmitry Vyukov <dvyukov@google.com>
Reviewed-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f61e869d
...@@ -56,7 +56,7 @@ static void fail_dump(struct fault_attr *attr) ...@@ -56,7 +56,7 @@ static void fail_dump(struct fault_attr *attr)
static bool fail_task(struct fault_attr *attr, struct task_struct *task) 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 #define MAX_STACK_TRACE_DEPTH 32
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册