Skip to content

afs: Fix probe handling, server rotation and RO volume callback handling

David Howells linux-fsdevel lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest40 patches 0 repliesNew
  2. v141 patches 14 repliesSuperseded 1 of 41 applied

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/40afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu()fs/afs/callback.c+2 -10 replies
2/40afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()fs/afs/server.c+4 -30 replies
3/40afs: use read_seqbegin() in afs_check_validity() and afs_getattr()fs/afs/inode.c+6 -90 replies
4/40rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock()net/rxrpc/conn_service.c+2 -10 replies
5/40afs: Remove whitespace before most ')' from the trace headerinclude/trace/events/afs.h+121 -1210 replies
6/40afs: Automatically generate trace tag enumsinclude/trace/events/afs.h+27 -2060 replies
7/40afs: Add comments on abort handlingfs/afs/rotate.c+90 -110 replies
8/40afs: Turn the afs_addr_list address array into an array of structsfs/afs/addr_list.c fs/afs/fs_probe.c fs/afs/internal.h +7 more+26 -220 replies
9/40rxrpc, afs: Allow afs to pin rxrpc_peer objectsfs/afs/addr_list.c fs/afs/cmservice.c fs/afs/fs_probe.c +17 more+273 -2380 replies
10/40afs: Don't skip server addresses for which we didn't get an RTT readingfs/afs/rotate.c fs/afs/vl_rotate.c+2 -20 replies
11/40afs: Rename addr_list::failed to probe_failedfs/afs/addr_list.c fs/afs/fs_probe.c fs/afs/internal.h +4 more+10 -100 replies
12/40afs: Handle the VIO and UAEIO aborts explicitlyfs/afs/rotate.c+7 -00 replies
13/40afs: Use op->nr_iterations=-1 to indicate to begin fileserver iterationfs/afs/fs_operation.c fs/afs/internal.h fs/afs/rotate.c+8 -70 replies
14/40afs: Wrap most op->error accesses with inline funcsfs/afs/dir.c fs/afs/file.c fs/afs/fs_operation.c +6 more+87 -670 replies
15/40afs: Don't put afs_call in afs_wait_for_call_to_complete()fs/afs/fs_operation.c fs/afs/fsclient.c fs/afs/internal.h +2 more+75 -760 replies
16/40afs: Simplify error handlingfs/afs/addr_list.c fs/afs/dir.c fs/afs/dir_silly.c +12 more+174 -1430 replies
17/40afs: Add a tracepoint for struct afs_addr_listfs/afs/addr_list.c fs/afs/fs_probe.c fs/afs/internal.h +7 more+100 -350 replies
18/40afs: Rename some fieldsfs/afs/internal.h fs/afs/rotate.c fs/afs/vl_rotate.c+38 -380 replies
19/40afs: Use peer + service_id as call addressfs/afs/addr_list.c fs/afs/fs_probe.c fs/afs/fsclient.c +6 more+48 -320 replies
20/40afs: Fold the afs_addr_cursor struct infs/afs/addr_list.c fs/afs/fs_operation.c fs/afs/fs_probe.c +9 more+243 -2140 replies
21/40rxrpc: Create a procfile to display outstanding client conn bundlesnet/rxrpc/ar-internal.h net/rxrpc/conn_client.c net/rxrpc/net_ns.c +1 more+94 -00 replies
22/40afs: Add some more info to /proc/net/afs/serversfs/afs/fs_operation.c fs/afs/fs_probe.c fs/afs/proc.c +2 more+22 -100 replies
23/40afs: Remove the unimplemented afs_cmp_addr_list()fs/afs/addr_list.c+0 -130 replies
24/40afs: Provide a way to configure address prioritiesfs/afs/Makefile fs/afs/addr_prefs.c fs/afs/internal.h +2 more+534 -10 replies
25/40afs: Mark address lists with configured prioritiesfs/afs/addr_prefs.c fs/afs/internal.h fs/afs/proc.c+91 -40 replies
26/40afs: Dispatch fileserver probes in priority orderfs/afs/fs_probe.c include/trace/events/afs.h+56 -20 replies
27/40afs: Dispatch vlserver probes in priority orderfs/afs/internal.h fs/afs/vl_list.c fs/afs/vl_probe.c +1 more+55 -20 replies
28/40afs: Keep a record of the current fileserver endpoint statefs/afs/fs_operation.c fs/afs/fs_probe.c fs/afs/fsclient.c +8 more+366 -2110 replies
29/40afs: Combine the endpoint state bools into a bitmaskfs/afs/fs_probe.c fs/afs/internal.h+21 -210 replies
30/40afs: Make it possible to find the volumes that are using a serverfs/afs/cell.c fs/afs/internal.h fs/afs/server.c +3 more+143 -320 replies
31/40afs: Defer volume record destruction to a workqueuefs/afs/cell.c fs/afs/fs_operation.c fs/afs/internal.h +3 more+19 -160 replies
32/40afs: Move the vnode/volume validity checking code into its own filefs/afs/Makefile fs/afs/inode.c fs/afs/internal.h +1 more+191 -1750 replies
33/40afs: Apply server breaks to mmap'd files in the call processorfs/afs/callback.c fs/afs/cell.c fs/afs/internal.h +3 more+34 -310 replies
34/40afs: Fix comment in afs_do_lookup()fs/afs/dir.c+2 -20 replies
35/40afs: Don't leave DONTUSE/NEWREPSITE servers out of server listfs/afs/internal.h fs/afs/rotate.c fs/afs/server_list.c +1 more+61 -260 replies
36/40afs: Parse the VolSync record in the reply of a number of RPC opsfs/afs/afs.h fs/afs/callback.c fs/afs/fs_operation.c +8 more+268 -200 replies
37/40afs: Overhaul invalidation handling to better support RO volumesfs/afs/callback.c fs/afs/cell.c fs/afs/dir.c +10 more+316 -2020 replies
38/40afs: Fix fileserver rotationfs/afs/fs_operation.c fs/afs/fs_probe.c fs/afs/internal.h +4 more+283 -1460 replies
39/40afs: Fix offline and busy message emissionfs/afs/internal.h fs/afs/rotate.c+25 -140 replies
40/40afs: trace: Log afs_make_call(), including server addressfs/afs/fsclient.c fs/afs/internal.h fs/afs/rxrpc.c +2 more+81 -00 replies

Reviews trailers per patch

1 of 40 patches has a Reviewed-by or Acked-by.

PatchJeffrey Altman
1/40
2/40
3/40
4/40
5/40
6/40
7/40R-b
8/40
9/40
10/40
11/40
12/40
13/40
14/40
15/40
16/40
17/40
18/40
19/40
20/40
21/40
22/40
23/40
24/40
25/40
26/40
27/40
28/40
29/40
30/40
31/40
32/40
33/40
34/40
35/40
36/40
37/40
38/40
39/40
40/40

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/40] afs: Fix probe handling, server rotation and RO volume callback handling

Hi Marc,

Here are a set of patches to make some substantial fixes to the afs filesystem including:

(1) Fix fileserver probe handling so that the next round of probes doesn't break ongoing server/address rotation by clearing all the probe result tracking. This could occasionally cause the rotation algorithm to drop straight through, give a 'successful' result without actually emitting any RPC calls, leaving the reply buffer in an undefined state.

Instead, detach the probe results into a separate struct and allocate a new one each time we start probing and update the pointer to it. Probes are also sent in order of address preference to try and improve the chance that the preferred one will complete first.

(2) Fix server rotation so that it uses configurable address preferences across on the probes that have completed so far than ranking them by RTT as the latter doesn't necessarily give the best route. The preference list can be altered by echoing commands into /proc/net/afs/addr_prefs.

(3) Fix the handling of Read-Only (and Backup) volume callbacks as there is one per volume, not one per file, so if someone performs a command that, say, offlines the volume but doesn't change it, when it comes back online we don't spam the server with a status fetch for every vnode we're using. Instead, check the Creation timestamp in the VolSync record when prompted by a callback break.

(4) Handle volume regression (ie. a RW volume being restored from a backup) by scrubbing all cache data for that volume. This is detected from the VolSync creation timestamp.

(5) Adjust abort handling and abort -> error mapping to match better with what other AFS clients do.

(6) Fix offline and busy volume state handling as they only apply to individual server instances and not entire volumes and the rotation algorithm should go and look at other servers if available. Also make it sleep briefly before each retry if all the volume instances are unavailable.

In addition there are a number of small fixes in rxrpc and afs included here so that those problems don't affect testing.

The patches can be found here:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes

Thanks,
David

Changes
=======
ver #2)
- Drop the first two rxrpc fix patches - one has gone through the net tree and the other needs a bit more work, but neither is necessary for this series.
- Add a couple of missing symbol exports.
- Treat UAEIO as VIO too.
- Switch to using atomic64_t for creation & update times because 64-bit cmpxchg isn't available on some 32-bit arches.
- Some patches went upstream separately as fixes (commit 5b7ad877e4d81f8904ce83982b1ba5c6e83deccb).
- Use atomic64_t for vnode->cb_expires_at() as 64-bit xchg() is not univerally available.
- Use rcu_access_pointer() rather than passing an __rcu pointer directly to kfree_rcu().

---
%(shortlog)s
%(diffstat)s

David Howells (36):
afs: Remove whitespace before most ')' from the trace header
afs: Automatically generate trace tag enums
afs: Add comments on abort handling
afs: Turn the afs_addr_list address array into an array of structs rxrpc, afs: Allow afs to pin rxrpc_peer objects
afs: Don't skip server addresses for which we didn't get an RTT
reading
afs: Rename addr_list::failed to probe_failed
afs: Handle the VIO and UAEIO aborts explicitly
afs: Use op->nr_iterations=-1 to indicate to begin fileserver
iteration
afs: Wrap most op->error accesses with inline funcs
afs: Don't put afs_call in afs_wait_for_call_to_complete()
afs: Simplify error handling
afs: Add a tracepoint for struct afs_addr_list
afs: Rename some fields
afs: Use peer + service_id as call address
afs: Fold the afs_addr_cursor struct in
rxrpc: Create a procfile to display outstanding client conn bundles
afs: Add some more info to /proc/net/afs/servers
afs: Remove the unimplemented afs_cmp_addr_list()
afs: Provide a way to configure address priorities
afs: Mark address lists with configured priorities
afs: Dispatch fileserver probes in priority order
afs: Dispatch vlserver probes in priority order
afs: Keep a record of the current fileserver endpoint state
afs: Combine the endpoint state bools into a bitmask
afs: Make it possible to find the volumes that are using a server
afs: Defer volume record destruction to a workqueue
afs: Move the vnode/volume validity checking code into its own file
afs: Apply server breaks to mmap'd files in the call processor
afs: Fix comment in afs_do_lookup()
afs: Don't leave DONTUSE/NEWREPSITE servers out of server list
afs: Parse the VolSync record in the reply of a number of RPC ops
afs: Overhaul invalidation handling to better support RO volumes
afs: Fix fileserver rotation
afs: Fix offline and busy message emission
afs: trace: Log afs_make_call(), including server address

Oleg Nesterov (4):
afs: fix the usage of read_seqbegin_or_lock() in
afs_lookup_volume_rcu()
afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()
afs: use read_seqbegin() in afs_check_validity() and afs_getattr() rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock()

 fs/afs/Makefile              |   2 +
 fs/afs/addr_list.c           | 224 +++++-----
 fs/afs/addr_prefs.c          | 531 ++++++++++++++++++++++++
 fs/afs/afs.h                 |   3 +-
 fs/afs/callback.c            | 141 ++++---
 fs/afs/cell.c                |   5 +-
 fs/afs/cmservice.c           |   5 +-
 fs/afs/dir.c                 |  59 +--
 fs/afs/dir_silly.c           |   2 +-
 fs/afs/file.c                |  20 +-
 fs/afs/fs_operation.c        |  85 ++--
 fs/afs/fs_probe.c            | 323 +++++++++------
 fs/afs/fsclient.c            |  74 +++-
 fs/afs/inode.c               | 204 +--------
 fs/afs/internal.h            | 370 +++++++++++------
 fs/afs/main.c                |   1 +
 fs/afs/misc.c                |  10 +-
 fs/afs/proc.c                | 102 ++++-
 fs/afs/rotate.c              | 520 ++++++++++++++++-------
 fs/afs/rxrpc.c               | 107 ++---
 fs/afs/server.c              | 135 +++---
 fs/afs/server_list.c         | 174 ++++++--
 fs/afs/super.c               |   7 +-
 fs/afs/validation.c          | 467 +++++++++++++++++++++
 fs/afs/vl_alias.c            |  69 +---
 fs/afs/vl_list.c             |  29 +-
 fs/afs/vl_probe.c            |  60 ++-
 fs/afs/vl_rotate.c           | 215 ++++++----
 fs/afs/vlclient.c            | 143 ++++---
 fs/afs/volume.c              |  61 ++-
 fs/afs/write.c               |   6 +-
 fs/afs/yfsclient.c           |  25 +-
 include/net/af_rxrpc.h       |  15 +-
 include/trace/events/afs.h   | 779 ++++++++++++++++++++---------------
 include/trace/events/rxrpc.h |   3 +
 net/rxrpc/af_rxrpc.c         |  62 ++-
 net/rxrpc/ar-internal.h      |   6 +-
 net/rxrpc/call_object.c      |  17 +-
 net/rxrpc/conn_client.c      |  10 +
 net/rxrpc/conn_service.c     |   3 +-
 net/rxrpc/net_ns.c           |   4 +
 net/rxrpc/peer_object.c      |  58 ++-
 net/rxrpc/proc.c             |  76 ++++
 net/rxrpc/sendmsg.c          |  11 +-
 44 files changed, 3532 insertions(+), 1691 deletions(-)
 create mode 100644 fs/afs/addr_prefs.c
 create mode 100644 fs/afs/validation.c