Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message May 8, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

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

From: Dmitry Vyukov <[email protected]>
Subject: 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.

---

 lib/fault-inject.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/fault-inject.c renamed from lib/fault-inject.c~fault-inject-use-correct-check-for-interrupts +1 -1
diff -puN lib/fault-inject.c~fault-inject-use-correct-check-for-interrupts lib/fault-inject.c
@@ -56,7 +56,7 @@ static void fail_dump(struct fault_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

_