Skip to contentSkip to conversation

fault-inject: use correct check for interrupts

PATCH Applied Dmitry Vyukov 2 participants 3 messages Mar 21, 2017 – Mar 28, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

Andrew, do you mind taking this to mm?

---
 lib/fault-inject.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/fault-inject.c +1 -1
index 6a823a53e357..4ff157159a0d 100644
@@ -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
Signature · 7 lines
2.12.1.500.gab5fba24ee-goog

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer Reviewed-by on v1 1/1
#1 lore raw

2017-03-21 18:18 GMT+09:00 Dmitry Vyukov <[email protected]>:

Quoted 9 lines

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.

This change looks good to me.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 11 lines · Akinobu Mita

2017-03-21 18:18 GMT+09:00 Dmitry Vyukov <[email protected]>:

Quoted 9 lines

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.

Quoted 3 lines

This change looks good to me.

Andrew, will you take this to mm please?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>