]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rds: tcp: Take explicit refcounts on struct net
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Fri, 16 Jun 2017 19:08:29 +0000 (12:08 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 18 Jun 2017 19:49:27 +0000 (12:49 -0700)
commitd0e7eab11c39f362737cc9b7921221501bc859ff
tree752a192b273dabeb76b27be4c7d376bbd2116048
parent08d3d26754de08b128891ff813d9e7bc8b3215ca
rds: tcp: Take explicit refcounts on struct net

It is incorrect for the rds_connection to piggyback on the
sock_net() refcount for the netns because this gives rise to
a chicken-and-egg problem during rds_conn_destroy. Instead explicitly
take a ref on the net, and hold the netns down till the connection
tear-down is complete.

Orabug: 26289770

(Cherry-pick of upstream 8edc3affc0770886c7bfb3436b0fdd09bce13167)

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
net/rds/connection.c
net/rds/rds.h
net/rds/tcp.c