summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-09-09 12:59:17 +0200
committerPeter Zijlstra <peterz@infradead.org>2021-09-15 17:49:15 +0200
commit7687201e37fabf2b7cf2b828f7ca46bf30e2948f (patch)
tree983890044173ba2359c708955bd59d69e8be612e /kernel
parentLinux 5.15-rc1 (diff)
downloadlinux-7687201e37fabf2b7cf2b828f7ca46bf30e2948f.tar.xz
linux-7687201e37fabf2b7cf2b828f7ca46bf30e2948f.zip
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
Diffstat (limited to 'kernel')
-rw-r--r--kernel/locking/rwbase_rt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/locking/rwbase_rt.c b/kernel/locking/rwbase_rt.c
index 4ba15088e640..542b0170e4f5 100644
--- a/kernel/locking/rwbase_rt.c
+++ b/kernel/locking/rwbase_rt.c
@@ -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;
}