Skip to content

Commit

Permalink
Merge tag 'rxrpc-next-20200914' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/dhowells/linux-fs

David Howells says:

====================
rxrpc: Fixes for the connection manager rewrite

Here are some fixes for the connection manager rewrite:

 (1) Fix a goto to the wrong place in error handling.

 (2) Fix a missing NULL pointer check.

 (3) The stored allocation error needs to be stored signed.

 (4) Fix a leak of connection bundle when clearing connections due to
     net namespace exit.

 (5) Fix an overget of the bundle when setting up a new client conn.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 14, 2020
2 parents 33acd75 + f1b4497 commit e0d9ae6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/trace/events/rxrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ TRACE_EVENT(rxrpc_client,
__entry->channel = channel;
__entry->usage = conn ? atomic_read(&conn->usage) : -2;
__entry->op = op;
__entry->cid = conn->proto.cid;
__entry->cid = conn ? conn->proto.cid : 0;
),

TP_printk("C=%08x h=%2d %s i=%08x u=%d",
Expand Down
2 changes: 1 addition & 1 deletion net/rxrpc/ar-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ struct rxrpc_bundle {
unsigned int debug_id;
bool try_upgrade; /* True if the bundle is attempting upgrade */
bool alloc_conn; /* True if someone's getting a conn */
unsigned short alloc_error; /* Error from last conn allocation */
short alloc_error; /* Error from last conn allocation */
spinlock_t channel_lock;
struct rb_node local_node; /* Node in local->client_conns */
struct list_head waiting_calls; /* Calls waiting for channels */
Expand Down
7 changes: 4 additions & 3 deletions net/rxrpc/conn_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ static void rxrpc_add_conn_to_bundle(struct rxrpc_bundle *bundle, gfp_t gfp)
if (!rxrpc_may_reuse_conn(old)) {
if (old)
trace_rxrpc_client(old, -1, rxrpc_client_replace);
candidate->bundle = rxrpc_get_bundle(bundle);
candidate->bundle_shift = shift;
bundle->conns[i] = candidate;
for (j = 0; j < RXRPC_MAXCALLS; j++)
Expand Down Expand Up @@ -724,8 +723,9 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
/* Paired with the write barrier in rxrpc_activate_one_channel(). */
smp_rmb();

out:
out_put_bundle:
rxrpc_put_bundle(bundle);
out:
_leave(" = %d", ret);
return ret;

Expand All @@ -742,7 +742,7 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
trace_rxrpc_client(call->conn, ret, rxrpc_client_chan_wait_failed);
rxrpc_set_call_completion(call, RXRPC_CALL_LOCAL_ERROR, 0, ret);
rxrpc_disconnect_client_call(bundle, call);
goto out;
goto out_put_bundle;
}

/*
Expand Down Expand Up @@ -1111,6 +1111,7 @@ void rxrpc_clean_up_local_conns(struct rxrpc_local *local)
conn = list_entry(graveyard.next,
struct rxrpc_connection, cache_link);
list_del_init(&conn->cache_link);
rxrpc_unbundle_conn(conn);
rxrpc_put_connection(conn);
}

Expand Down

0 comments on commit e0d9ae6

Please sign in to comment.