diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index df5997d25826..de870184e457 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1728,7 +1728,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1728 | 1728 | ||
1729 | msg->msg_namelen = 0; | 1729 | msg->msg_namelen = 0; |
1730 | 1730 | ||
1731 | mutex_lock(&u->readlock); | 1731 | err = mutex_lock_interruptible(&u->readlock); |
1732 | if (err) { | ||
1733 | err = sock_intr_errno(sock_rcvtimeo(sk, noblock)); | ||
1734 | goto out; | ||
1735 | } | ||
1732 | 1736 | ||
1733 | skb = skb_recv_datagram(sk, flags, noblock, &err); | 1737 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
1734 | if (!skb) { | 1738 | if (!skb) { |
@@ -1868,7 +1872,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1868 | memset(&tmp_scm, 0, sizeof(tmp_scm)); | 1872 | memset(&tmp_scm, 0, sizeof(tmp_scm)); |
1869 | } | 1873 | } |
1870 | 1874 | ||
1871 | mutex_lock(&u->readlock); | 1875 | err = mutex_lock_interruptible(&u->readlock); |
1876 | if (err) { | ||
1877 | err = sock_intr_errno(timeo); | ||
1878 | goto out; | ||
1879 | } | ||
1872 | 1880 | ||
1873 | do { | 1881 | do { |
1874 | int chunk; | 1882 | int chunk; |
@@ -1899,11 +1907,12 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1899 | 1907 | ||
1900 | timeo = unix_stream_data_wait(sk, timeo); | 1908 | timeo = unix_stream_data_wait(sk, timeo); |
1901 | 1909 | ||
1902 | if (signal_pending(current)) { | 1910 | if (signal_pending(current) |
1911 | || mutex_lock_interruptible(&u->readlock)) { | ||
1903 | err = sock_intr_errno(timeo); | 1912 | err = sock_intr_errno(timeo); |
1904 | goto out; | 1913 | goto out; |
1905 | } | 1914 | } |
1906 | mutex_lock(&u->readlock); | 1915 | |
1907 | continue; | 1916 | continue; |
1908 | unlock: | 1917 | unlock: |
1909 | unix_state_unlock(sk); | 1918 | unix_state_unlock(sk); |