mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 18:20:25 +02:00
locking/rwbase: Properly match set_and_save_state() to restore_state()
Noticed while looking at the readers race. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Will Deacon <will@kernel.org> Link: https://lkml.kernel.org/r/20210909110203.828203010@infradead.org
This commit is contained in:
parent
6880fa6c56
commit
7687201e37
1 changed files with 1 additions and 1 deletions
|
|
@ -220,7 +220,7 @@ static int __sched rwbase_write_lock(struct rwbase_rt *rwb,
|
||||||
for (; atomic_read(&rwb->readers);) {
|
for (; atomic_read(&rwb->readers);) {
|
||||||
/* Optimized out for rwlocks */
|
/* Optimized out for rwlocks */
|
||||||
if (rwbase_signal_pending_state(state, current)) {
|
if (rwbase_signal_pending_state(state, current)) {
|
||||||
__set_current_state(TASK_RUNNING);
|
rwbase_restore_current_state();
|
||||||
__rwbase_write_unlock(rwb, 0, flags);
|
__rwbase_write_unlock(rwb, 0, flags);
|
||||||
return -EINTR;
|
return -EINTR;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue