Commit 29fb4ec3 authored by David Howells's avatar David Howells
Browse files

rxrpc: Remove RCU from peer->error_targets list



Remove the RCU requirements from the peer's list of error targets so that
the error distributor can call sleeping functions.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
parent cf37b598
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -433,6 +433,12 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,
	 */
	rxrpc_put_call(call, rxrpc_call_put_discard_prealloc);

	if (hlist_unhashed(&call->error_link)) {
		spin_lock(&call->peer->lock);
		hlist_add_head(&call->error_link, &call->peer->error_targets);
		spin_unlock(&call->peer->lock);
	}

	_leave(" = %p{%d}", call, call->debug_id);
	return call;

+1 −1
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ void rxrpc_incoming_call(struct rxrpc_sock *rx,
	rcu_assign_pointer(conn->channels[chan].call, call);

	spin_lock(&conn->peer->lock);
	hlist_add_head_rcu(&call->error_link, &conn->peer->error_targets);
	hlist_add_head(&call->error_link, &conn->peer->error_targets);
	spin_unlock(&conn->peer->lock);

	rxrpc_start_call_timer(call);
+4 −0
Original line number Diff line number Diff line
@@ -786,6 +786,10 @@ void rxrpc_expose_client_call(struct rxrpc_call *call)
		if (chan->call_counter >= INT_MAX)
			set_bit(RXRPC_CONN_DONT_REUSE, &conn->flags);
		trace_rxrpc_client(conn, channel, rxrpc_client_exposed);

		spin_lock(&call->peer->lock);
		hlist_add_head(&call->error_link, &call->peer->error_targets);
		spin_unlock(&call->peer->lock);
	}
}

+3 −3
Original line number Diff line number Diff line
@@ -215,9 +215,9 @@ void rxrpc_disconnect_call(struct rxrpc_call *call)
	call->peer->cong_ssthresh = call->cong_ssthresh;

	if (!hlist_unhashed(&call->error_link)) {
		spin_lock_bh(&call->peer->lock);
		hlist_del_rcu(&call->error_link);
		spin_unlock_bh(&call->peer->lock);
		spin_lock(&call->peer->lock);
		hlist_del_init(&call->error_link);
		spin_unlock(&call->peer->lock);
	}

	if (rxrpc_is_client_call(call))
+0 −6
Original line number Diff line number Diff line
@@ -394,12 +394,6 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb)

	_enter("%x,{%d}", txb->seq, txb->len);

	if (hlist_unhashed(&call->error_link)) {
		spin_lock_bh(&call->peer->lock);
		hlist_add_head_rcu(&call->error_link, &call->peer->error_targets);
		spin_unlock_bh(&call->peer->lock);
	}

	/* Each transmission of a Tx packet needs a new serial number */
	serial = atomic_inc_return(&conn->serial);
	txb->wire.serial = htonl(serial);
Loading