Skip to content

Commit ef4d3ea

Browse files
Marc Dionnetorvalds
authored andcommitted
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: 2757a4d ("afs: Fix access after dec in put functions") Signed-off-by: Marc Dionne <[email protected]> Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Linus Torvalds <[email protected]>
1 parent 04aa643 commit ef4d3ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/afs/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ void afs_put_server(struct afs_net *net, struct afs_server *server,
406406
if (!server)
407407
return;
408408

409-
a = atomic_inc_return(&server->active);
409+
a = atomic_read(&server->active);
410410
zero = __refcount_dec_and_test(&server->ref, &r);
411411
trace_afs_server(debug_id, r - 1, a, reason);
412412
if (unlikely(zero))

0 commit comments

Comments
 (0)