diff options
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 1c3c1f3a3ec4..b1314c099417 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -2263,14 +2263,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state) | |||
2263 | /* Lock the socket to prevent queue disordering | 2263 | /* Lock the socket to prevent queue disordering |
2264 | * while sleeps in memcpy_tomsg | 2264 | * while sleeps in memcpy_tomsg |
2265 | */ | 2265 | */ |
2266 | err = mutex_lock_interruptible(&u->readlock); | 2266 | mutex_lock(&u->readlock); |
2267 | if (unlikely(err)) { | ||
2268 | /* recvmsg() in non blocking mode is supposed to return -EAGAIN | ||
2269 | * sk_rcvtimeo is not honored by mutex_lock_interruptible() | ||
2270 | */ | ||
2271 | err = noblock ? -EAGAIN : -ERESTARTSYS; | ||
2272 | goto out; | ||
2273 | } | ||
2274 | 2267 | ||
2275 | if (flags & MSG_PEEK) | 2268 | if (flags & MSG_PEEK) |
2276 | skip = sk_peek_offset(sk, flags); | 2269 | skip = sk_peek_offset(sk, flags); |
@@ -2314,12 +2307,12 @@ again: | |||
2314 | timeo = unix_stream_data_wait(sk, timeo, last, | 2307 | timeo = unix_stream_data_wait(sk, timeo, last, |
2315 | last_len); | 2308 | last_len); |
2316 | 2309 | ||
2317 | if (signal_pending(current) || | 2310 | if (signal_pending(current)) { |
2318 | mutex_lock_interruptible(&u->readlock)) { | ||
2319 | err = sock_intr_errno(timeo); | 2311 | err = sock_intr_errno(timeo); |
2320 | goto out; | 2312 | goto out; |
2321 | } | 2313 | } |
2322 | 2314 | ||
2315 | mutex_lock(&u->readlock); | ||
2323 | continue; | 2316 | continue; |
2324 | unlock: | 2317 | unlock: |
2325 | unix_state_unlock(sk); | 2318 | unix_state_unlock(sk); |