Commit be8b27b6 authored by Joseph Salisbury's avatar Joseph Salisbury Committed by Tim Gardner

Revert "Revert "af_unix: Revert 'lock_interruptible' in stream receive code""

BugLink: http://bugs.launchpad.net/bugs/1558447

This reverts commit d45d44e0.
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 6f984332
...@@ -2293,14 +2293,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state) ...@@ -2293,14 +2293,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state)
/* Lock the socket to prevent queue disordering /* Lock the socket to prevent queue disordering
* while sleeps in memcpy_tomsg * while sleeps in memcpy_tomsg
*/ */
err = mutex_lock_interruptible(&u->readlock); mutex_lock(&u->readlock);
if (unlikely(err)) {
/* recvmsg() in non blocking mode is supposed to return -EAGAIN
* sk_rcvtimeo is not honored by mutex_lock_interruptible()
*/
err = noblock ? -EAGAIN : -ERESTARTSYS;
goto out;
}
if (flags & MSG_PEEK) if (flags & MSG_PEEK)
skip = sk_peek_offset(sk, flags); skip = sk_peek_offset(sk, flags);
...@@ -2346,13 +2339,13 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state) ...@@ -2346,13 +2339,13 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state)
timeo = unix_stream_data_wait(sk, timeo, last, timeo = unix_stream_data_wait(sk, timeo, last,
last_len); last_len);
if (signal_pending(current) || if (signal_pending(current)) {
mutex_lock_interruptible(&u->readlock)) {
err = sock_intr_errno(timeo); err = sock_intr_errno(timeo);
scm_destroy(&scm); scm_destroy(&scm);
goto out; goto out;
} }
mutex_lock(&u->readlock);
continue; continue;
unlock: unlock:
unix_state_unlock(sk); unix_state_unlock(sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment