Commit d45d44e0 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Tim Gardner

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

This reverts commit 3822b5c2.

BugLink: http://bugs.launchpad.net/bugs/1540731Signed-off-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent 904dbe44
......@@ -2286,7 +2286,14 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state)
/* Lock the socket to prevent queue disordering
* while sleeps in memcpy_tomsg
*/
mutex_lock(&u->readlock);
err = mutex_lock_interruptible(&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)
skip = sk_peek_offset(sk, flags);
......@@ -2330,12 +2337,12 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state)
timeo = unix_stream_data_wait(sk, timeo, last,
last_len);
if (signal_pending(current)) {
if (signal_pending(current) ||
mutex_lock_interruptible(&u->readlock)) {
err = sock_intr_errno(timeo);
goto out;
}
mutex_lock(&u->readlock);
continue;
unlock:
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