diff options
author | James Morris <james.l.morris@oracle.com> | 2017-03-28 02:03:35 +0200 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2017-03-28 02:03:35 +0200 |
commit | 840c91dc6a13b160f5b6e5c79c430dffac11c945 (patch) | |
tree | 5309824f4531b2611a575e7971a935d2e95feb02 /kernel/locking/rwsem-spinlock.c | |
parent | LSM: Initialize security_hook_heads upon registration. (diff) | |
parent | Linux 4.11-rc4 (diff) | |
download | linux-840c91dc6a13b160f5b6e5c79c430dffac11c945.tar.xz linux-840c91dc6a13b160f5b6e5c79c430dffac11c945.zip |
update to v4.11-rc4 due to memory corruption bug in rc2
Diffstat (limited to 'kernel/locking/rwsem-spinlock.c')
-rw-r--r-- | kernel/locking/rwsem-spinlock.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/kernel/locking/rwsem-spinlock.c b/kernel/locking/rwsem-spinlock.c index 7bc24d477805..c65f7989f850 100644 --- a/kernel/locking/rwsem-spinlock.c +++ b/kernel/locking/rwsem-spinlock.c @@ -213,10 +213,9 @@ int __sched __down_write_common(struct rw_semaphore *sem, int state) */ if (sem->count == 0) break; - if (signal_pending_state(state, current)) { - ret = -EINTR; - goto out; - } + if (signal_pending_state(state, current)) + goto out_nolock; + set_current_state(state); raw_spin_unlock_irqrestore(&sem->wait_lock, flags); schedule(); @@ -224,12 +223,19 @@ int __sched __down_write_common(struct rw_semaphore *sem, int state) } /* got the lock */ sem->count = -1; -out: list_del(&waiter.list); raw_spin_unlock_irqrestore(&sem->wait_lock, flags); return ret; + +out_nolock: + list_del(&waiter.list); + if (!list_empty(&sem->wait_list)) + __rwsem_do_wake(sem, 1); + raw_spin_unlock_irqrestore(&sem->wait_lock, flags); + + return -EINTR; } void __sched __down_write(struct rw_semaphore *sem) |