linux-stable/fs/afs
Oleg Nesterov 36f1e250b5 afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()
[ Upstream commit 1702e0654c ]

David Howells says:

 (5) afs_find_server().

     There could be a lot of servers in the list and each server can have
     multiple addresses, so I think this would be better with an exclusive
     second pass.

     The server list isn't likely to change all that often, but when it does
     change, there's a good chance several servers are going to be
     added/removed one after the other.  Further, this is only going to be
     used for incoming cache management/callback requests from the server,
     which hopefully aren't going to happen too often - but it is remotely
     drivable.

 (6) afs_find_server_by_uuid().

     Similarly to (5), there could be a lot of servers to search through, but
     they are in a tree not a flat list, so it should be faster to process.
     Again, it's not likely to change that often and, again, when it does
     change it's likely to involve multiple changes.  This can be driven
     remotely by an incoming cache management request but is mostly going to
     be driven by setting up or reconfiguring a volume's server list -
     something that also isn't likely to happen often.

Make the "seq" counter odd on the 2nd pass, otherwise read_seqbegin_or_lock()
never takes the lock.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/20231130115614.GA21581@redhat.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 08:12:45 +01:00
..
Kconfig
Makefile afs: Handle CONFIG_PROC_FS=n 2018-06-15 00:52:55 -04:00
addr_list.c Merge branch 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-16 16:32:04 +09:00
afs.h
afs_cm.h
afs_fs.h
afs_vl.h
cache.c
callback.c afs: Fix lock-wait/callback-break double locking 2020-01-27 14:50:49 +01:00
cell.c afs: Fix characters allowed into cell names 2020-01-29 16:43:18 +01:00
cmservice.c afs: Fix the CB.ProbeUuid service handler to reply correctly 2019-09-06 10:21:54 +02:00
dir.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
dir_edit.c afs: Remove set but not used variables 'before', 'after' 2020-01-27 14:51:22 +01:00
dynroot.c afs: Fix the dynamic root's d_delete to always delete unused dentries 2024-01-08 11:27:34 +01:00
file.c afs: Fix key leak in afs_release() and afs_evict_inode() 2020-01-27 14:50:48 +01:00
flock.c afs: Fix lock-wait/callback-break double locking 2020-01-27 14:50:49 +01:00
fsclient.c Merge branch 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-16 16:32:04 +09:00
inode.c afs: Fix dynamic root getattr 2022-07-02 16:27:33 +02:00
internal.h afs: Fix uninitialised spinlock afs_volume::cb_break_lock 2019-07-21 09:03:06 +02:00
main.c afs: Fix an IS_ERR() vs NULL check 2021-06-30 08:48:14 -04:00
misc.c
mntpt.c
netdevices.c afs: Implement network namespacing 2018-05-23 12:01:15 +01:00
proc.c afs: Fix memory leak in afs_put_sysnames() 2020-06-25 15:33:04 +02:00
rotate.c rxrpc: Fix handling of call quietly cancelled out on server 2018-06-04 16:06:26 -04:00
rxrpc.c afs: Fix some tracing details 2020-04-02 15:28:19 +02:00
security.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
server.c afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*() 2024-02-23 08:12:45 +01:00
server_list.c
super.c afs: Fix large file support 2020-01-27 14:51:20 +01:00
vlclient.c afs: Fix loop index mixup in afs_deliver_vl_get_entry_by_name_u() 2019-09-06 10:21:54 +02:00
volume.c afs: Fix uninitialised spinlock afs_volume::cb_break_lock 2019-07-21 09:03:06 +02:00
write.c afs: afs_write_end() should change i_size under the right lock 2020-06-25 15:33:06 +02:00
xattr.c afs: Fix the afs.cell and afs.volume xattr handlers 2020-01-27 14:50:45 +01:00
xdr_fs.h