rxrpc: Fix lack of conn cleanup when local endpoint is cleaned up [ver #2]
Subsystems (2)
Quoted 8 lines · Hillf Danton
Review
Quoted 5 lines
(quoted diff) +1
-1- if (rxnet->live) { + if (rxnet->live && !conn->params.local->dead) { idle_timestamp = READ_ONCE(conn->idle_timestamp); expire_at = idle_timestamp + rxrpc_connection_expiry * HZ; if (conn->params.local->service_closed)Is there any chance out there that this reaper starts running one minute after the dead local went into graveyard?
It's certainly possible that that can happen. The reaper is per network-namespace.
conn->params.local holds a ref on the local endpoint.
It may be worth wrapping the "local->dead = true;" in rxrpc_local_destroyer() in rxnet->conn_lock.
David
Quoted 9 lines · Hillf Danton
Quoted 5 lines
It's certainly possible that that can happen. The reaper is per network-namespace.
conn->params.localholds a ref on the local endpoint.Then local endpoint can not become dead without connection reaper running first, because of the ref held by connection. When it is dead, however, there is no need to run reaper directly (rather than through a workqueue).
The reaper is per-net_ns, not per-local. There may be more than one local endpoint in a net_ns and they share the list of service connections.
David