]> git.baikalelectronics.ru Git - kernel.git/commit
rds: tcp: Take explicit refcounts on struct net
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Sat, 4 Mar 2017 16:57:33 +0000 (08:57 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Mar 2017 22:09:59 +0000 (14:09 -0800)
commit1d6cb465628f29e2267d092de68a496dc9ba17e7
treecfe3a2ae7348961f4c8872ffd5158d2ba4e35235
parent5a6a2a478faa23fad9fc862ab05beee80465f482
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.

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