aboutsummaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorDhiren Parmar <dparmar@nvidia.com>2015-01-19 10:07:19 -0800
committerDhiren Parmar <dparmar@nvidia.com>2015-01-20 00:32:41 -0800
commit14f7ad1b1befe178caa36cb0ed920bdad7030663 (patch)
treed3f5574e67e01829dab71848e3540a551ea2b5b1 /net/unix/af_unix.c
parent1330d02ca9b244e6f5525c529c2ed5f859bdad6c (diff)
Revert "Merge branch 'linux-3.10.y' into HEAD"
Seems to have caused Encryption failure. This reverts commit 077753ed93a33dc11e7273938870df9e1740ff5d. Change-Id: I3d3ac40054fb5624bc45134d344a641689d6b5ed Signed-off-by: Dhiren Parmar <dparmar@nvidia.com> Reviewed-on: http://git-master/r/673728
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index c80c107139f..f246812680d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -161,8 +161,9 @@ static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
static inline unsigned int unix_hash_fold(__wsum n)
{
- unsigned int hash = (__force unsigned int)csum_fold(n);
+ unsigned int hash = (__force unsigned int)n;
+ hash ^= hash>>16;
hash ^= hash>>8;
return hash&(UNIX_HASH_SIZE-1);
}
@@ -1793,11 +1794,8 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
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;
+ if (err) {
+ err = sock_intr_errno(sock_rcvtimeo(sk, noblock));
goto out;
}
@@ -1917,7 +1915,6 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr = msg->msg_name;
int copied = 0;
- int noblock = flags & MSG_DONTWAIT;
int check_creds = 0;
int target;
int err = 0;
@@ -1933,7 +1930,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
goto out;
target = sock_rcvlowat(sk, flags&MSG_WAITALL, size);
- timeo = sock_rcvtimeo(sk, noblock);
+ timeo = sock_rcvtimeo(sk, flags&MSG_DONTWAIT);
/* Lock the socket to prevent queue disordering
* while sleeps in memcpy_tomsg
@@ -1945,11 +1942,8 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
}
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;
+ if (err) {
+ err = sock_intr_errno(timeo);
goto out;
}