diff options
author | David S. Miller <davem@davemloft.net> | 2014-03-29 18:48:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-29 18:48:54 -0400 |
commit | 64c27237a07129758e33f5f824ba5c33b7f57417 (patch) | |
tree | 4c0c0a9b6d282d600f2226e1b3510096b9d789dd /net/unix/af_unix.c | |
parent | 77a9939426f7a3f35f460afc9b11f1fe45955409 (diff) | |
parent | 49d8137a4039c63c834827f4bfe875e27bb9c521 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/marvell/mvneta.c
The mvneta.c conflict is a case of overlapping changes,
a conversion to devm_ioremap_resource() vs. a conversion
to netdev_alloc_pcpu_stats.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index ce6ec6c2f4de..94404f19f9de 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1787,8 +1787,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1787 | goto out; | 1787 | goto out; |
1788 | 1788 | ||
1789 | err = mutex_lock_interruptible(&u->readlock); | 1789 | err = mutex_lock_interruptible(&u->readlock); |
1790 | if (err) { | 1790 | if (unlikely(err)) { |
1791 | err = sock_intr_errno(sock_rcvtimeo(sk, noblock)); | 1791 | /* recvmsg() in non blocking mode is supposed to return -EAGAIN |
1792 | * sk_rcvtimeo is not honored by mutex_lock_interruptible() | ||
1793 | */ | ||
1794 | err = noblock ? -EAGAIN : -ERESTARTSYS; | ||
1792 | goto out; | 1795 | goto out; |
1793 | } | 1796 | } |
1794 | 1797 | ||
@@ -1913,6 +1916,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1913 | struct unix_sock *u = unix_sk(sk); | 1916 | struct unix_sock *u = unix_sk(sk); |
1914 | DECLARE_SOCKADDR(struct sockaddr_un *, sunaddr, msg->msg_name); | 1917 | DECLARE_SOCKADDR(struct sockaddr_un *, sunaddr, msg->msg_name); |
1915 | int copied = 0; | 1918 | int copied = 0; |
1919 | int noblock = flags & MSG_DONTWAIT; | ||
1916 | int check_creds = 0; | 1920 | int check_creds = 0; |
1917 | int target; | 1921 | int target; |
1918 | int err = 0; | 1922 | int err = 0; |
@@ -1928,7 +1932,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1928 | goto out; | 1932 | goto out; |
1929 | 1933 | ||
1930 | target = sock_rcvlowat(sk, flags&MSG_WAITALL, size); | 1934 | target = sock_rcvlowat(sk, flags&MSG_WAITALL, size); |
1931 | timeo = sock_rcvtimeo(sk, flags&MSG_DONTWAIT); | 1935 | timeo = sock_rcvtimeo(sk, noblock); |
1932 | 1936 | ||
1933 | /* Lock the socket to prevent queue disordering | 1937 | /* Lock the socket to prevent queue disordering |
1934 | * while sleeps in memcpy_tomsg | 1938 | * while sleeps in memcpy_tomsg |
@@ -1940,8 +1944,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1940 | } | 1944 | } |
1941 | 1945 | ||
1942 | err = mutex_lock_interruptible(&u->readlock); | 1946 | err = mutex_lock_interruptible(&u->readlock); |
1943 | if (err) { | 1947 | if (unlikely(err)) { |
1944 | err = sock_intr_errno(timeo); | 1948 | /* recvmsg() in non blocking mode is supposed to return -EAGAIN |
1949 | * sk_rcvtimeo is not honored by mutex_lock_interruptible() | ||
1950 | */ | ||
1951 | err = noblock ? -EAGAIN : -ERESTARTSYS; | ||
1945 | goto out; | 1952 | goto out; |
1946 | } | 1953 | } |
1947 | 1954 | ||