diff options
author | David Howells <dhowells@redhat.com> | 2023-10-31 16:30:37 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2024-01-01 16:37:27 +0000 |
commit | f49b594df3ebca53c91f4d6448680463f10aa479 (patch) | |
tree | d18f0048178320274cf73b7e62c4cbb3a8ae9b80 /fs/afs/fs_operation.c | |
parent | e6a7d7f71b17e0a44e2155bdad47eae7b5368503 (diff) | |
download | linux-f49b594df3ebca53c91f4d6448680463f10aa479.tar.gz linux-f49b594df3ebca53c91f4d6448680463f10aa479.tar.bz2 linux-f49b594df3ebca53c91f4d6448680463f10aa479.zip |
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
Diffstat (limited to 'fs/afs/fs_operation.c')
-rw-r--r-- | fs/afs/fs_operation.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index e760e11d5bcb..8c6d827f999d 100644 --- a/fs/afs/fs_operation.c +++ b/fs/afs/fs_operation.c @@ -228,6 +228,7 @@ void afs_wait_for_operation(struct afs_operation *op) */ int afs_put_operation(struct afs_operation *op) { + struct afs_endpoint_state *estate = op->estate; struct afs_addr_list *alist; int i, ret = afs_op_error(op); @@ -251,14 +252,16 @@ int afs_put_operation(struct afs_operation *op) kfree(op->more_files); } - alist = op->alist; - if (alist) { - if (op->call_responded && - op->addr_index != alist->preferred && - test_bit(alist->preferred, &op->addr_tried)) - WRITE_ONCE(alist->preferred, op->addr_index); - afs_put_addrlist(alist, afs_alist_trace_put_operation); - op->alist = NULL; + if (estate) { + alist = estate->addresses; + if (alist) { + if (op->call_responded && + op->addr_index != alist->preferred && + test_bit(alist->preferred, &op->addr_tried)) + WRITE_ONCE(alist->preferred, op->addr_index); + } + afs_put_endpoint_state(estate, afs_estate_trace_put_operation); + op->estate = NULL; } afs_put_serverlist(op->net, op->server_list); |