summaryrefslogtreecommitdiffstats
path: root/lib/fault-inject.c
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-05-08 15:56:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-08 17:15:12 -0700
commitf2ad37da805414e9385e7ca2961e1d0431df3799 (patch)
treef9b7298389afda5d32bb4dae3e243816eb252f6f /lib/fault-inject.c
parentf61e869d519c0c11a8d80a503cfdfb4897df855a (diff)
downloadlinux-stable-f2ad37da805414e9385e7ca2961e1d0431df3799.tar.gz
linux-stable-f2ad37da805414e9385e7ca2961e1d0431df3799.tar.bz2
linux-stable-f2ad37da805414e9385e7ca2961e1d0431df3799.zip
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.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>
Diffstat (limited to 'lib/fault-inject.c')
-rw-r--r--lib/fault-inject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index 6a823a53e357..4ff157159a0d 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -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