summaryrefslogtreecommitdiffstats
path: root/net/rds/bind.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2018-10-05 14:19:02 +0200
committerWolfram Sang <wsa@the-dreams.de>2018-10-05 14:19:02 +0200
commit05552832204e37e038d550e1354300eb11a9e5ec (patch)
tree69f7ef1f98e2382b35d7e6098705c00fcfa3d3c3 /net/rds/bind.c
parent49d54abee9d1507e117a4218dc5baa3ebc5b93f1 (diff)
parent9a9e295e7c5c0409c020088b0ae017e6c2b7df6e (diff)
downloadlinux-05552832204e37e038d550e1354300eb11a9e5ec.tar.bz2
Merge tag 'at24-4.20-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-4.20
AT24 updates for 4.20 Single patch from Wang Xin improving the read/write loop in at24 under high load.
Diffstat (limited to 'net/rds/bind.c')
-rw-r--r--net/rds/bind.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/rds/bind.c b/net/rds/bind.c
index 3ab55784b637..762d2c6788a3 100644
--- a/net/rds/bind.c
+++ b/net/rds/bind.c
@@ -76,11 +76,13 @@ struct rds_sock *rds_find_bound(const struct in6_addr *addr, __be16 port,
struct rds_sock *rs;
__rds_create_bind_key(key, addr, port, scope_id);
- rs = rhashtable_lookup_fast(&bind_hash_table, key, ht_parms);
+ rcu_read_lock();
+ rs = rhashtable_lookup(&bind_hash_table, key, ht_parms);
if (rs && !sock_flag(rds_rs_to_sk(rs), SOCK_DEAD))
rds_sock_addref(rs);
else
rs = NULL;
+ rcu_read_unlock();
rdsdebug("returning rs %p for %pI6c:%u\n", rs, addr,
ntohs(port));
@@ -235,6 +237,7 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out;
}
+ sock_set_flag(sk, SOCK_RCU_FREE);
ret = rds_add_bound(rs, binding_addr, &port, scope_id);
if (ret)
goto out;