acrn-kernel/fs/afs
Oleg Nesterov ea4eb77c53 afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()
[ Upstream commit 1702e0654ca9a7bcd7c7619c8a5004db58945b71 ]

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-05 20:12:48 +00:00
..
Kconfig
Makefile
addr_list.c
afs.h
afs_cm.h
afs_fs.h
afs_vl.h
callback.c afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu() 2024-02-05 20:12:48 +00:00
cell.c afs: Fix overwriting of result of DNS query 2024-01-01 12:38:58 +00:00
cmservice.c
dir.c afs: Hide silly-rename files from userspace 2024-01-31 16:17:04 -08:00
dir_edit.c
dir_silly.c
dynroot.c afs: Fix dynamic root lookup DNS check 2024-01-01 12:38:57 +00:00
file.c
flock.c
fs_operation.c
fs_probe.c
fsclient.c
inode.c
internal.h mm, netfs, fscache: stop read optimisation when folio removed from pagecache 2024-01-10 17:10:31 +01:00
main.c
misc.c
mntpt.c
proc.c
protocol_afs.h
protocol_uae.h
protocol_yfs.h
rotate.c
rxrpc.c afs: Fix refcount underflow from error handling race 2023-12-20 17:00:15 +01:00
security.c
server.c afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*() 2024-02-05 20:12:48 +00:00
server_list.c afs: Fix afs_server_list to be cleaned up with RCU 2023-12-03 07:32:06 +01:00
super.c afs: Fix file locking on R/O volumes to operate in local mode 2023-12-03 07:32:08 +01:00
vl_alias.c
vl_list.c
vl_probe.c
vl_rotate.c afs: Return ENOENT if no cell DNS record can be found 2023-12-03 07:32:08 +01:00
vlclient.c
volume.c afs: Fix use-after-free due to get/remove race in volume tree 2024-01-01 12:38:58 +00:00
write.c
xattr.c
xdr_fs.h
yfsclient.c