From: Dmitry Vyukov <dvyukov@google.com>
To: akinobu.mita@gmail.com, akpm@linux-foundation.org
Cc: Dmitry Vyukov <dvyukov@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH] fault-inject: use correct check for interrupts
Date: Tue, 21 Mar 2017 10:18:05 +0100 [thread overview]
Message-ID: <20170321091805.140676-1-dvyukov@google.com> (raw)
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@google.com>
Cc: akinobu.mita@gmail.com
Cc: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.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
next reply other threads:[~2017-03-21 9:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 9:18 Dmitry Vyukov [this message]
2017-03-25 7:18 ` [PATCH] fault-inject: use correct check for interrupts Akinobu Mita
2017-03-28 9:58 ` Dmitry Vyukov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170321091805.140676-1-dvyukov@google.com \
--to=dvyukov@google.com \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).