[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170321091805.140676-1-dvyukov@google.com>
Date: Tue, 21 Mar 2017 10:18:05 +0100
From: Dmitry Vyukov <dvyukov@...gle.com>
To: akinobu.mita@...il.com, akpm@...ux-foundation.org
Cc: Dmitry Vyukov <dvyukov@...gle.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: [PATCH] fault-inject: 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.
Signed-off-by: Dmitry Vyukov <dvyukov@...gle.com>
Cc: akinobu.mita@...il.com
Cc: linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org
---
Andrew, do you mind taking this to mm?
---
lib/fault-inject.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
--
2.12.1.500.gab5fba24ee-goog
Powered by blists - more mailing lists