diff mbox

[Xenial,1/1] Revert "Revert "af_unix: Revert 'lock_interruptible' in stream receive code""

Message ID aa2d921a09b44fc7ac5506be8b27dd503e9fc629.1458249327.git.joseph.salisbury@canonical.com
State New
Headers show

Commit Message

Joseph Salisbury March 17, 2016, 9:28 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1558447

This reverts commit d45d44e002a9db710bde7c9a5831dd3324b32813.
---
 net/unix/af_unix.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index e2ccd7e..898a53a 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2293,14 +2293,7 @@  static int unix_stream_read_generic(struct unix_stream_read_state *state)
 	/* Lock the socket to prevent queue disordering
 	 * while sleeps in memcpy_tomsg
 	 */
-	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;
-	}
+	mutex_lock(&u->readlock);
 
 	if (flags & MSG_PEEK)
 		skip = sk_peek_offset(sk, flags);
@@ -2346,13 +2339,13 @@  again:
 			timeo = unix_stream_data_wait(sk, timeo, last,
 						      last_len);
 
-			if (signal_pending(current) ||
-			    mutex_lock_interruptible(&u->readlock)) {
+			if (signal_pending(current)) {
 				err = sock_intr_errno(timeo);
 				scm_destroy(&scm);
 				goto out;
 			}
 
+			mutex_lock(&u->readlock);
 			continue;
 unlock:
 			unix_state_unlock(sk);