SUNRPC: Don't leak sockets in xs_local_connect()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 28 Apr 2022 15:08:13 +0000 (11:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 May 2022 10:32:37 +0000 (12:32 +0200)
commit4807f902910c576a1e00a86868a2542d959d1b47
tree73731f8278336e6a7fc430987fd79c8d87f930ab
parent4fd6c1d43ffa7b92d4b1d3266159119443ccdbc3
SUNRPC: Don't leak sockets in xs_local_connect()

commit aad41a7d7cf6c6fa804c872a2480f8e541da37cf upstream.

If there is still a closed socket associated with the transport, then we
need to trigger an autoclose before we can set up a new connection.

Reported-by: wanghai (M) <wanghai38@huawei.com>
Fixes: f00432063db1 ("SUNRPC: Ensure we flush any closed sockets before xs_xprt_free()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/xprtsock.c