afs: Keep a record of the current fileserver endpoint state
authorDavid Howells <dhowells@redhat.com>
Tue, 31 Oct 2023 16:30:37 +0000 (16:30 +0000)
committerDavid Howells <dhowells@redhat.com>
Mon, 1 Jan 2024 16:37:27 +0000 (16:37 +0000)
commitf49b594df3ebca53c91f4d6448680463f10aa479
treed18f0048178320274cf73b7e62c4cbb3a8ae9b80
parente6a7d7f71b17e0a44e2155bdad47eae7b5368503
afs: Keep a record of the current fileserver endpoint state

Keep a record of the current fileserver endpoint state, including the probe
state, and replace it when a new probe is started rather than just
squelching the old state and overwriting it.  Clearance of the old state
can cause a race if there's another thread also currently trying to
communicate with that server.

It appears that this race might be the culprit for some occasions where
kafs complains about invalid data in the RPC reply because the rotation
algorithm fell all the way through without actually issuing an RPC call and
the error return got filled in from the probe state (which has a zero error
recorded).  Whatever happens to be in the caller's reply buffer is then
taken as the response.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
fs/afs/fs_operation.c
fs/afs/fs_probe.c
fs/afs/fsclient.c
fs/afs/internal.h
fs/afs/proc.c
fs/afs/rotate.c
fs/afs/server.c
fs/afs/vl_alias.c
fs/afs/vl_probe.c
fs/afs/vlclient.c
include/trace/events/afs.h