diff mbox series

[17/18] core/lock: improve bust_locks

Message ID 20171119091508.28372-18-npiggin@gmail.com
State Superseded
Headers show
Series move direct controls out of fast-reboot, | expand

Commit Message

Nicholas Piggin Nov. 19, 2017, 9:15 a.m. UTC
Prevent try_lock from modifying the lock state when bust_locks is set.
unlock will not unlock it in that case, so locks will get taken and
never released.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 core/lock.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/core/lock.c b/core/lock.c
index 916a0241..b5e3323f 100644
--- a/core/lock.c
+++ b/core/lock.c
@@ -93,6 +93,9 @@  bool try_lock(struct lock *l)
 {
 	struct cpu_thread *cpu = this_cpu();
 
+	if (bust_locks)
+		return true;
+
 	if (__try_lock(cpu, l)) {
 		if (l->in_con_path)
 			cpu->con_suspend++;