提交 ef4d3ea4 编写于 作者: M Marc Dionne 提交者: Linus Torvalds

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: 2757a4dc ("afs: Fix access after dec in put functions")
Signed-off-by: NMarc Dionne <marc.dionne@auristor.com>
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20221130174053.2665818-1-marc.dionne@auristor.com/Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 04aa6437
...@@ -406,7 +406,7 @@ void afs_put_server(struct afs_net *net, struct afs_server *server, ...@@ -406,7 +406,7 @@ void afs_put_server(struct afs_net *net, struct afs_server *server,
if (!server) if (!server)
return; return;
a = atomic_inc_return(&server->active); a = atomic_read(&server->active);
zero = __refcount_dec_and_test(&server->ref, &r); zero = __refcount_dec_and_test(&server->ref, &r);
trace_afs_server(debug_id, r - 1, a, reason); trace_afs_server(debug_id, r - 1, a, reason);
if (unlikely(zero)) if (unlikely(zero))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册