Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5326909rdb; Wed, 13 Dec 2023 05:52:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBa7SDSJ/8xU1hxsG7NhOV3mNerEFx+T3A+LWKXZMJJhP9ZGL+hHQS5WBeMmVHZtFsDWS1 X-Received: by 2002:a05:6359:4282:b0:170:64cd:8aac with SMTP id kp2-20020a056359428200b0017064cd8aacmr9157612rwb.62.1702475573403; Wed, 13 Dec 2023 05:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702475573; cv=none; d=google.com; s=arc-20160816; b=cy+Bx6pNIzXogVwTL2e3jSJHjVrsd/Mdmp77x2cWIyotmieUEtMZy6+3db11XFeq4M eqyFB6GHNIs9JznTOsjV+35aedo5LrQD059KeiAap+c14J6Teunz0VZx0kdGVO5+WfKj r5j9F9ZzxGROMl50kMKNeUHVEuSYYYbcEGL0GrNLnUX/UJv0vto93COGk2dewx3D0m/S afCYF00zMD25ENtZ1GUAbIx5tmunTe++HUG5x3VKWX9BL/E9GaO96dxFtwyG5vUsn3Dl 0tkpO5X/CayvaDk/LMftSP8JFxqjDzCELXeOTBs077cGdeoU5fxxzk/cbzm737DU0pr/ lu3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cmTCmlX4lZl7P2Vj72SHk6r4dvh7rcubOpN6X02yzKI=; fh=9hT4l0EMR1D2zdgUoRXiqFwsybSJyrmM/FC/blQlPsI=; b=woN8E2KZdm3A1ifCunpkAmwu0fr0yt6Q5jN716SgUzXDHfNG+2taYILthhaqTVLd/4 hjvhvVcTiP3y/NYU7pjgTQbyHxnPy0Fl8npAbcoaqDcqiY94Ctqt0sO/h2xlPOgIDtzQ 7rsz6Q3cAXv5RzHLWFLkNk9BQvnziMpF/F4oUNdT4Pf/0XVgMJSkLEsMC+F5D+oT60SW po6r+9SBARzqQnA7cVem+NBM/ILDok6z79fcPlYKjIm1D2MwCw6jC2hkPJFVJp9QUAI+ 1JqYLTuifq2Kp/Dr0o7BwxEdLsBADR9p+wwyzPyRmZGOMf+RA/o9ldBgH279L3FXZusv MALA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="SaM6q/k6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u2-20020a63df02000000b005c6bc10835fsi9464769pgg.84.2023.12.13.05.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 05:52:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="SaM6q/k6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 806B180B06D2; Wed, 13 Dec 2023 05:52:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441850AbjLMNv6 (ORCPT + 99 others); Wed, 13 Dec 2023 08:51:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379292AbjLMNu5 (ORCPT ); Wed, 13 Dec 2023 08:50:57 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6986010F for ; Wed, 13 Dec 2023 05:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702475448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cmTCmlX4lZl7P2Vj72SHk6r4dvh7rcubOpN6X02yzKI=; b=SaM6q/k6jtuq+PLQVrBRQQUookWoS054CnkUxUtB2JeBiAgD2Oa8fjrt2/XIVXRJgjYTyC Supn6PwYIWmQa4lthTZ/daJ7rpfLuGOE/lmxQYEH3P0m/BRwkJoiSIuQt2dhJYcPdgfftJ DR4sWBjWpSokhb6d0ubqjtwtfFprvT0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-578-rOMX1xUVPMmZgouvnKpkTQ-1; Wed, 13 Dec 2023 08:50:43 -0500 X-MC-Unique: rOMX1xUVPMmZgouvnKpkTQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 213B8185A782; Wed, 13 Dec 2023 13:50:42 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5667E40C6EB9; Wed, 13 Dec 2023 13:50:41 +0000 (UTC) From: David Howells To: Marc Dionne Cc: David Howells , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 22/40] afs: Add some more info to /proc/net/afs/servers Date: Wed, 13 Dec 2023 13:49:44 +0000 Message-ID: <20231213135003.367397-23-dhowells@redhat.com> In-Reply-To: <20231213135003.367397-1-dhowells@redhat.com> References: <20231213135003.367397-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 05:52:44 -0800 (PST) In /proc/net/afs/servers, show the cell name and the last error for each address in the server's list. cc: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/fs_operation.c | 2 -- fs/afs/fs_probe.c | 2 ++ fs/afs/proc.c | 24 ++++++++++++++++-------- fs/afs/rotate.c | 2 ++ fs/afs/vl_rotate.c | 2 ++ 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index 00e22259be36..e760e11d5bcb 100644 --- a/fs/afs/fs_operation.c +++ b/fs/afs/fs_operation.c @@ -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); } } diff --git a/fs/afs/fs_probe.c b/fs/afs/fs_probe.c index aef16ac3f577..8008d3ecabab 100644 --- a/fs/afs/fs_probe.c +++ b/fs/afs/fs_probe.c @@ -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) { diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 16d93fa6396f..0b43bb9b0260 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -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; } diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c index a6bda8f44c0f..5423ac80f4e0 100644 --- a/fs/afs/rotate.c +++ b/fs/afs/rotate.c @@ -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: diff --git a/fs/afs/vl_rotate.c b/fs/afs/vl_rotate.c index 91168528179c..d8f79f6ada3d 100644 --- a/fs/afs/vl_rotate.c +++ b/fs/afs/vl_rotate.c @@ -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: