linux-stable/fs/afs
David Howells 2068d41a3d afs: Fix lost servers_outstanding count
[ Upstream commit 36f82c93ee ]

The afs_fs_probe_dispatcher() work function is passed a count on
net->servers_outstanding when it is scheduled (which may come via its
timer).  This is passed back to the work_item, passed to the timer or
dropped at the end of the dispatcher function.

But, at the top of the dispatcher function, there are two checks which
skip the rest of the function: if the network namespace is being destroyed
or if there are no fileservers to probe.  These two return paths, however,
do not drop the count passed to the dispatcher, and so, sometimes, the
destruction of a network namespace, such as induced by rmmod of the kafs
module, may get stuck in afs_purge_servers(), waiting for
net->servers_outstanding to become zero.

Fix this by adding the missing decrements in afs_fs_probe_dispatcher().

Fixes: f6cbb368bc ("afs: Actively poll fileservers to maintain NAT or firewall openings")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/167164544917.2072364.3759519569649459359.stgit@warthog.procyon.org.uk/
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:14:45 +01:00
..
addr_list.c
afs.h
afs_cm.h
afs_fs.h
afs_vl.h
cache.c
callback.c
cell.c
cmservice.c
dir.c afs: Fix infinite loop found by xfstest generic/676 2022-06-14 18:36:13 +02:00
dir_edit.c
dir_silly.c
dynroot.c
file.c afs: Fix mmap 2021-12-22 09:32:45 +01:00
flock.c afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:30:05 +02:00
fs_operation.c
fs_probe.c afs: Fix lost servers_outstanding count 2022-12-31 13:14:45 +01:00
fsclient.c afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:30:05 +02:00
inode.c afs: Fix dynamic root getattr 2022-06-29 09:03:25 +02:00
internal.h afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:30:05 +02:00
Kconfig
main.c
Makefile
misc.c afs: Return -EAGAIN, not -EREMOTEIO, when a file already locked 2022-09-23 14:15:51 +02:00
mntpt.c
proc.c
protocol_afs.h
protocol_uae.h
protocol_yfs.h
rotate.c afs: Adjust ACK interpretation to try and cope with NAT 2022-06-09 10:22:40 +02:00
rxrpc.c afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:30:05 +02:00
security.c
server.c
server_list.c
super.c afs: Fix mmap 2021-12-22 09:32:45 +01:00
vl_alias.c
vl_list.c
vl_probe.c
vl_rotate.c
vlclient.c
volume.c
write.c afs: Adjust ACK interpretation to try and cope with NAT 2022-06-09 10:22:40 +02:00
xattr.c
xdr_fs.h
yfsclient.c afs: Use the operation issue time instead of the reply time for callbacks 2022-09-15 11:30:05 +02:00