linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net 7/7] afs: Fix error handling in VL server rotation
Date: Thu, 27 Aug 2020 16:04:22 +0100	[thread overview]
Message-ID: <159854066219.1382667.2526502599415329370.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <159854061331.1382667.9693163318506702951.stgit@warthog.procyon.org.uk>

The error handling in the VL server rotation in the case of there being no
contactable servers is not correct.  In such a case, the records of all the
servers in the list are scanned and the errors and abort codes are mapped
and prioritised and one error is chosen.  This is then forgotten and the
default error is used (EDESTADDRREQ).

Fix this by using the calculated error.

Also we need to note whether a server responded on one of its endpoints so
that we can priorise an error from an abort message over local and network
errors.

Fixes: 4584ae96ae30 ("afs: Fix missing net error handling")
Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/afs/vl_rotate.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/afs/vl_rotate.c b/fs/afs/vl_rotate.c
index ab2beb4ba20e..c0458c903b31 100644
--- a/fs/afs/vl_rotate.c
+++ b/fs/afs/vl_rotate.c
@@ -263,10 +263,14 @@ bool afs_select_vlserver(struct afs_vl_cursor *vc)
 	for (i = 0; i < vc->server_list->nr_servers; i++) {
 		struct afs_vlserver *s = vc->server_list->servers[i].server;
 
+		if (test_bit(AFS_VLSERVER_FL_RESPONDING, &s->flags))
+			e.responded = true;
 		afs_prioritise_error(&e, READ_ONCE(s->probe.error),
 				     s->probe.abort_code);
 	}
 
+	error = e.error;
+
 failed_set_error:
 	vc->error = error;
 failed:



  parent reply	other threads:[~2020-08-27 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 15:03 [PATCH net 0/7] rxrpc, afs: Fix probing issues David Howells
2020-08-27 15:03 ` [PATCH net 1/7] rxrpc: Keep the ACK serial in a var in rxrpc_input_ack() David Howells
2020-08-27 15:03 ` [PATCH net 2/7] rxrpc: Fix loss of RTT samples due to interposed ACK David Howells
2020-08-27 15:03 ` [PATCH net 3/7] rxrpc: Make rxrpc_kernel_get_srtt() indicate validity David Howells
2020-08-27 15:04 ` [PATCH net 4/7] afs: Remove afs_vlserver->probe.have_result David Howells
2020-08-27 15:04 ` [PATCH net 5/7] afs: Expose information from afs_vlserver through /proc for debugging David Howells
2020-08-27 15:04 ` [PATCH net 6/7] afs: Don't use VL probe running state to make decisions outside probe code David Howells
2020-08-27 15:04 ` David Howells [this message]
2020-08-27 19:56 ` [PATCH net 0/7] rxrpc, afs: Fix probing issues David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159854066219.1382667.2526502599415329370.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).