Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37d3257d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "locking/osq_lock: Fix osq_lock queue corruption"

parents 8e2d779f 3c25a9d5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -106,6 +106,19 @@ bool osq_lock(struct optimistic_spin_queue *lock)

	prev = decode_cpu(old);
	node->prev = prev;

	/*
	 * osq_lock()			unqueue
	 *
	 * node->prev = prev		osq_wait_next()
	 * WMB				MB
	 * prev->next = node		next->prev = prev // unqueue-C
	 *
	 * Here 'node->prev' and 'next->prev' are the same variable and we need
	 * to ensure these stores happen in-order to avoid corrupting the list.
	 */
	smp_wmb();

	WRITE_ONCE(prev->next, node);

	/*