Commit 3df91ea2 authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by Johan Hedberg

Bluetooth: Revert to mutexes from RCU list

Usage of RCU list looks not reasonalbe for a number of reasons:
our code sleep and we had to use socket spinlocks. Most parts
of code are updaters thus there is little sense to use RCU.
Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Reviewed-by: default avatarUlisses Furquim <ulisses@profusion.mobi>
Acked-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 1b009c98
This diff is collapsed.
...@@ -796,6 +796,7 @@ static int l2cap_sock_shutdown(struct socket *sock, int how) ...@@ -796,6 +796,7 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct l2cap_chan *chan; struct l2cap_chan *chan;
struct l2cap_conn *conn;
int err = 0; int err = 0;
BT_DBG("sock %p, sk %p", sock, sk); BT_DBG("sock %p, sk %p", sock, sk);
...@@ -804,6 +805,10 @@ static int l2cap_sock_shutdown(struct socket *sock, int how) ...@@ -804,6 +805,10 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
return 0; return 0;
chan = l2cap_pi(sk)->chan; chan = l2cap_pi(sk)->chan;
conn = chan->conn;
if (conn)
mutex_lock(&conn->chan_lock);
lock_sock(sk); lock_sock(sk);
if (!sk->sk_shutdown) { if (!sk->sk_shutdown) {
...@@ -811,6 +816,7 @@ static int l2cap_sock_shutdown(struct socket *sock, int how) ...@@ -811,6 +816,7 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
err = __l2cap_wait_ack(sk); err = __l2cap_wait_ack(sk);
sk->sk_shutdown = SHUTDOWN_MASK; sk->sk_shutdown = SHUTDOWN_MASK;
l2cap_chan_close(chan, 0); l2cap_chan_close(chan, 0);
if (sock_flag(sk, SOCK_LINGER) && sk->sk_lingertime) if (sock_flag(sk, SOCK_LINGER) && sk->sk_lingertime)
...@@ -822,6 +828,10 @@ static int l2cap_sock_shutdown(struct socket *sock, int how) ...@@ -822,6 +828,10 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
err = -sk->sk_err; err = -sk->sk_err;
release_sock(sk); release_sock(sk);
if (conn)
mutex_unlock(&conn->chan_lock);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment