Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1428612 > unrolled thread

[PATCH net-next 10/14] rxrpc: Calls displayed in /proc may in future lack a connection

Started byDavid Howells <dhowells@redhat.com>
First post2016-06-22 12:00 +0200
Last post2016-06-22 12:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net-next 10/14] rxrpc: Calls displayed in /proc may in  future lack a connection David Howells <dhowells@redhat.com> - 2016-06-22 12:00 +0200

#1428612 — [PATCH net-next 10/14] rxrpc: Calls displayed in /proc may in future lack a connection

FromDavid Howells <dhowells@redhat.com>
Date2016-06-22 12:00 +0200
Subject[PATCH net-next 10/14] rxrpc: Calls displayed in /proc may in future lack a connection
Message-ID<rMN6V-1Ju-1@gated-at.bofh.it>
Allocated rxrpc calls displayed in /proc/net/rxrpc_calls may in future be
on the proc list before they're connected or after they've been
disconnected - in which case they may not have a pointer to a connection
struct that can be used to get data from there.

Deal with this by using stuff from the call struct in preference where
possible and printing "no_connection" rather than a peer address if no
connection is assigned.

This change also has the added bonus that the service ID is now taken from
the call rather the connection which will allow per-call service upgrades
to be shown - something required for AuriStor server compatibility.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/proc.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/net/rxrpc/proc.c b/net/rxrpc/proc.c
index 9863270691d7..500cdcdc843c 100644
--- a/net/rxrpc/proc.c
+++ b/net/rxrpc/proc.c
@@ -59,25 +59,28 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)
 	}
 
 	call = list_entry(v, struct rxrpc_call, link);
-	conn = call->conn;
 
 	sprintf(lbuff, "%pI4:%u",
-		&conn->params.local->srx.transport.sin.sin_addr,
-		ntohs(conn->params.local->srx.transport.sin.sin_port));
+		&call->local->srx.transport.sin.sin_addr,
+		ntohs(call->local->srx.transport.sin.sin_port));
 
-	sprintf(rbuff, "%pI4:%u",
-		&conn->params.peer->srx.transport.sin.sin_addr,
-		ntohs(conn->params.peer->srx.transport.sin.sin_port));
+	conn = call->conn;
+	if (conn)
+		sprintf(rbuff, "%pI4:%u",
+			&conn->params.peer->srx.transport.sin.sin_addr,
+			ntohs(conn->params.peer->srx.transport.sin.sin_port));
+	else
+		strcpy(rbuff, "no_connection");
 
 	seq_printf(seq,
 		   "UDP   %-22.22s %-22.22s %4x %08x %08x %s %3u"
 		   " %-8.8s %08x %lx\n",
 		   lbuff,
 		   rbuff,
-		   call->conn->params.service_id,
+		   call->service_id,
 		   call->cid,
 		   call->call_id,
-		   rxrpc_conn_is_service(call->conn) ? "Svc" : "Clt",
+		   call->in_clientflag ? "Svc" : "Clt",
 		   atomic_read(&call->usage),
 		   rxrpc_call_states[call->state],
 		   call->remote_abort ?: call->local_abort,

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web