linux/debian/patches/debian/revert-net-unix-allow-set_p...

74 lines
1.9 KiB
Diff

From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 19 Jan 2014 18:59:53 +0000
Subject: Revert "net: unix: allow set_peek_off to fail"
This reverts commit 12663bfc97c8b3fdb292428105dd92d563164050
which was backported into 3.12.8 and would cause an ABI change.
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -180,7 +180,7 @@ struct proto_ops {
int offset, size_t size, int flags);
ssize_t (*splice_read)(struct socket *sock, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len, unsigned int flags);
- int (*set_peek_off)(struct sock *sk, int val);
+ void (*set_peek_off)(struct sock *sk, int val);
};
#define DECLARE_SOCKADDR(type, dst, src) \
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -888,7 +888,7 @@ set_rcvbuf:
case SO_PEEK_OFF:
if (sock->ops->set_peek_off)
- ret = sock->ops->set_peek_off(sk, val);
+ sock->ops->set_peek_off(sk, val);
else
ret = -EOPNOTSUPP;
break;
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -530,17 +530,13 @@ static int unix_seqpacket_sendmsg(struct
static int unix_seqpacket_recvmsg(struct kiocb *, struct socket *,
struct msghdr *, size_t, int);
-static int unix_set_peek_off(struct sock *sk, int val)
+static void unix_set_peek_off(struct sock *sk, int val)
{
struct unix_sock *u = unix_sk(sk);
- if (mutex_lock_interruptible(&u->readlock))
- return -EINTR;
-
+ mutex_lock(&u->readlock);
sk->sk_peek_off = val;
mutex_unlock(&u->readlock);
-
- return 0;
}
@@ -718,9 +714,7 @@ static int unix_autobind(struct socket *
int err;
unsigned int retries = 0;
- err = mutex_lock_interruptible(&u->readlock);
- if (err)
- return err;
+ mutex_lock(&u->readlock);
err = 0;
if (u->addr)
@@ -879,9 +873,7 @@ static int unix_bind(struct socket *sock
goto out;
addr_len = err;
- err = mutex_lock_interruptible(&u->readlock);
- if (err)
- goto out;
+ mutex_lock(&u->readlock);
err = -EINVAL;
if (u->addr)