From: Marc Dionne Date: Wed, 30 Nov 2022 17:55:51 +0000 (+0000) Subject: afs: Fix server->active leak in afs_put_server X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6.1.0-rc7-00103-gef4d3ea40565;p=linux.git afs: Fix server->active leak in afs_put_server The atomic_read was accidentally replaced with atomic_inc_return, which prevents the server from getting cleaned up and causes rmmod to hang with a warning: Can't purge s=00000001 Fixes: 2757a4dc1849 ("afs: Fix access after dec in put functions") Signed-off-by: Marc Dionne Signed-off-by: David Howells Link: https://lore.kernel.org/r/20221130174053.2665818-1-marc.dionne@auristor.com/ Signed-off-by: Linus Torvalds --- diff --git a/fs/afs/server.c b/fs/afs/server.c index 4981baf97835c..b5237206eac3e 100644 --- a/fs/afs/server.c +++ b/fs/afs/server.c @@ -406,7 +406,7 @@ void afs_put_server(struct afs_net *net, struct afs_server *server, if (!server) return; - a = atomic_inc_return(&server->active); + a = atomic_read(&server->active); zero = __refcount_dec_and_test(&server->ref, &r); trace_afs_server(debug_id, r - 1, a, reason); if (unlikely(zero))