From e666b23336e27b436096b5f9c326ed0175862d24 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 5 Jun 2007 13:10:29 -0700 Subject: [PATCH] --- yaml --- r: 57436 b: refs/heads/master c: 3c0d2f3780fc94746c4842e965bd2570e2119bb6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/unix/af_unix.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index cb636d27e6fd..f7855b3b8263 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c764c9ade6d9b710bad2b9c631ede9864333b98c +refs/heads/master: 3c0d2f3780fc94746c4842e965bd2570e2119bb6 diff --git a/trunk/net/unix/af_unix.c b/trunk/net/unix/af_unix.c index 87c794d8fa2d..d70fa30d4294 100644 --- a/trunk/net/unix/af_unix.c +++ b/trunk/net/unix/af_unix.c @@ -1744,20 +1744,23 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, int chunk; struct sk_buff *skb; + unix_state_lock(sk); skb = skb_dequeue(&sk->sk_receive_queue); if (skb==NULL) { if (copied >= target) - break; + goto unlock; /* * POSIX 1003.1g mandates this order. */ if ((err = sock_error(sk)) != 0) - break; + goto unlock; if (sk->sk_shutdown & RCV_SHUTDOWN) - break; + goto unlock; + + unix_state_unlock(sk); err = -EAGAIN; if (!timeo) break; @@ -1771,7 +1774,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, } mutex_lock(&u->readlock); continue; + unlock: + unix_state_unlock(sk); + break; } + unix_state_unlock(sk); if (check_creds) { /* Never glue messages from different writers */