Skip to content

Commit

Permalink
locking/rwbase: Properly match set_and_save_state() to restore_state()
Browse files Browse the repository at this point in the history
Noticed while looking at the readers race.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Acked-by: Will Deacon <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
Peter Zijlstra committed Sep 15, 2021
1 parent 6880fa6 commit 7687201
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/locking/rwbase_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static int __sched rwbase_write_lock(struct rwbase_rt *rwb,
for (; atomic_read(&rwb->readers);) {
/* Optimized out for rwlocks */
if (rwbase_signal_pending_state(state, current)) {
__set_current_state(TASK_RUNNING);
rwbase_restore_current_state();
__rwbase_write_unlock(rwb, 0, flags);
return -EINTR;
}
Expand Down

0 comments on commit 7687201

Please sign in to comment.