Skip to content

Commit

Permalink
rxrpc: Fix bundle counting for exclusive connections
Browse files Browse the repository at this point in the history
Fix rxrpc_unbundle_conn() to not drop the bundle usage count when cleaning
up an exclusive connection.

Based on the suggested fix from Hillf Danton.

Fixes: 245500d ("rxrpc: Rewrite the client connection manager")
Reported-by: [email protected]
Signed-off-by: David Howells <[email protected]>
cc: Hillf Danton <[email protected]>
  • Loading branch information
dhowells committed Oct 15, 2020
1 parent d25e2e9 commit f3af4ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/rxrpc/conn_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
struct rxrpc_bundle *bundle = conn->bundle;
struct rxrpc_local *local = bundle->params.local;
unsigned int bindex;
bool need_drop = false;
bool need_drop = false, need_put = false;
int i;

_enter("C=%x", conn->debug_id);
Expand All @@ -928,10 +928,11 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
if (i == ARRAY_SIZE(bundle->conns) && !bundle->params.exclusive) {
_debug("erase bundle");
rb_erase(&bundle->local_node, &local->client_bundles);
need_put = true;
}

spin_unlock(&local->client_bundles_lock);
if (i == ARRAY_SIZE(bundle->conns))
if (need_put)
rxrpc_put_bundle(bundle);
}

Expand Down

0 comments on commit f3af4ad

Please sign in to comment.