Merge tag 'v3.10.95' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / unix / af_unix.c
index 8db136a9d87b05ad1195402223028236f30326ce..5bf16d9d43301b907ffb936e7e37ca06c8c82200 100644 (file)
@@ -1622,7 +1622,11 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
        int max_level;
        int data_len = 0;
        int sk_locked;
+<<<<<<< HEAD
         
+=======
+
+>>>>>>> v3.10.95
        if (NULL == siocb->scm)
                siocb->scm = &tmp_scm;
        wait_for_unix_gc();
@@ -1714,7 +1718,13 @@ restart_locked:
                sock_put(other);
 
                if (!sk_locked)
+<<<<<<< HEAD
                unix_state_lock(sk);
+=======
+                       unix_state_lock(sk);
+
+               err = 0;
+>>>>>>> v3.10.95
                if (unix_peer(sk) == other) {
                        unix_peer(sk) = NULL;
                        unix_dgram_peer_wake_disconnect_wakeup(sk, other);
@@ -1744,12 +1754,16 @@ restart_locked:
                        goto out_unlock;
        }
 
+<<<<<<< HEAD
        /* other == sk && unix_peer(other) != sk if
         * - unix_peer(sk) == NULL, destination address bound to sk
         * - unix_peer(sk) == sk by time of get but disconnected before lock
         */
        if (other != sk &&
            unlikely(unix_peer(other) != sk && unix_recvq_full(other))) {
+=======
+       if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) {
+>>>>>>> v3.10.95
                if (timeo) {
                        timeo = unix_wait_for_peer(other, timeo);
 
@@ -2016,14 +2030,7 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
        if (flags&MSG_OOB)
                goto out;
 
-       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);
 
        skip = sk_peek_offset(sk, flags);
 
@@ -2258,12 +2265,12 @@ again:
                                  
                         }
 
-                       if (signal_pending(current)
-                           ||  mutex_lock_interruptible(&u->readlock)) {
+                       if (signal_pending(current)) {
                                err = sock_intr_errno(timeo);
                                goto out;
                        }
 
+                       mutex_lock(&u->readlock);
                        continue;
  unlock:
                        unix_state_unlock(sk);