linux-stable/fs/afs
David Howells 0e8ed2d66d afs: Give an afs_server object a ref on the afs_cell object it points to
[ Upstream commit 1f0fc3374f ]

Give an afs_server object a ref on the afs_cell object it points to so that
the cell doesn't get deleted before the server record.

Whilst this is circular (cell -> vol -> server_list -> server -> cell), the
ref only pins the memory, not the lifetime as that's controlled by the
activity counter.  When the volume's activity counter reaches 0, it
detaches from the cell and discards its server list; when a cell's activity
counter reaches 0, it discards its root volume.  At that point, the
circularity is cut.

Fixes: d2ddc776a4 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20250218192250.296870-6-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-03-07 18:25:29 +01:00
..
addr_list.c
addr_prefs.c
afs_cm.h
afs_fs.h
afs_vl.h
afs.h
callback.c
cell.c
cmservice.c
dir_edit.c
dir_silly.c
dir.c
dynroot.c
file.c
flock.c
fs_operation.c
fs_probe.c
fsclient.c
inode.c
internal.h
Kconfig
main.c
Makefile
misc.c
mntpt.c
proc.c
protocol_afs.h
protocol_uae.h
protocol_yfs.h
rotate.c
rxrpc.c
security.c
server_list.c afs: Fix the server_list to unuse a displaced server rather than putting it 2025-03-07 18:25:29 +01:00
server.c afs: Give an afs_server object a ref on the afs_cell object it points to 2025-03-07 18:25:29 +01:00
super.c
validation.c
vl_alias.c
vl_list.c
vl_probe.c
vl_rotate.c
vlclient.c
volume.c
write.c
xattr.c
xdr_fs.h
yfsclient.c afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call 2025-02-08 09:56:53 +01:00