afs: Add some more info to /proc/net/afs/servers

In /proc/net/afs/servers, show the cell name and the last error for each
address in the server's list.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
This commit is contained in:
David Howells 2023-10-27 10:45:56 +01:00
parent d2ce4a84c2
commit af9a5b4930
5 changed files with 22 additions and 10 deletions

View File

@ -196,8 +196,6 @@ void afs_wait_for_operation(struct afs_operation *op)
op->call_abort_code = op->call->abort_code;
op->call_error = op->call->error;
op->call_responded = op->call->responded;
WRITE_ONCE(op->alist->addrs[op->addr_index].last_error,
op->call_error);
afs_put_call(op->call);
}
}

View File

@ -107,6 +107,8 @@ void afs_fileserver_probe_result(struct afs_call *call)
_enter("%pU,%u", &server->uuid, index);
WRITE_ONCE(addr->last_error, ret);
spin_lock(&server->probe_lock);
switch (ret) {

View File

@ -377,31 +377,39 @@ static int afs_proc_servers_show(struct seq_file *m, void *v)
{
struct afs_server *server;
struct afs_addr_list *alist;
unsigned long failed;
int i;
if (v == SEQ_START_TOKEN) {
seq_puts(m, "UUID REF ACT\n");
seq_puts(m, "UUID REF ACT CELL\n");
return 0;
}
server = list_entry(v, struct afs_server, proc_link);
alist = rcu_dereference(server->addresses);
seq_printf(m, "%pU %3d %3d\n",
seq_printf(m, "%pU %3d %3d %s\n",
&server->uuid,
refcount_read(&server->ref),
atomic_read(&server->active));
atomic_read(&server->active),
server->cell->name);
seq_printf(m, " - info: fl=%lx rtt=%u brk=%x\n",
server->flags, server->rtt, server->cb_s_break);
seq_printf(m, " - probe: last=%d out=%d\n",
(int)(jiffies - server->probed_at) / HZ,
atomic_read(&server->probe_outstanding));
failed = alist->probe_failed;
seq_printf(m, " - ALIST v=%u rsp=%lx f=%lx\n",
alist->version, alist->responded, alist->probe_failed);
for (i = 0; i < alist->nr_addrs; i++)
seq_printf(m, " [%x] %pISpc%s rtt=%d\n",
i, rxrpc_kernel_remote_addr(alist->addrs[i].peer),
alist->preferred == i ? "*" : "",
rxrpc_kernel_get_srtt(alist->addrs[i].peer));
for (i = 0; i < alist->nr_addrs; i++) {
const struct afs_address *addr = &alist->addrs[i];
seq_printf(m, " [%x] %pISpc%s rtt=%d err=%d\n",
i, rxrpc_kernel_remote_addr(addr->peer),
alist->preferred == i ? "*" :
test_bit(i, &failed) ? "!" : "",
rxrpc_kernel_get_srtt(addr->peer),
addr->last_error);
}
return 0;
}

View File

@ -133,6 +133,8 @@ bool afs_select_fileserver(struct afs_operation *op)
if (op->nr_iterations == 0)
goto start;
WRITE_ONCE(alist->addrs[op->addr_index].last_error, error);
/* Evaluate the result of the previous operation, if there was one. */
switch (op->call_error) {
case 0:

View File

@ -114,6 +114,8 @@ bool afs_select_vlserver(struct afs_vl_cursor *vc)
if (vc->nr_iterations == 0)
goto start;
WRITE_ONCE(alist->addrs[vc->addr_index].last_error, error);
/* Evaluate the result of the previous operation, if there was one. */
switch (error) {
default: