Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

afs: Fix afs_server struct leak

Fix a leak of afs_server structs. The routine that installs them in the
various lookup lists and trees gets a ref on leaving the function, whether
it added the server or a server already exists. It shouldn't increment
the refcount if it added the server.

The effect of this that "rmmod kafs" will hang waiting for the leaked
server to become unused.

Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

David Howells and committed by
Greg Kroah-Hartman
f014ffb0 b40afc00

+2
+2
fs/afs/server.c
··· 199 199 200 200 write_sequnlock(&net->fs_addr_lock); 201 201 ret = 0; 202 + goto out; 202 203 203 204 exists: 204 205 afs_get_server(server); 206 + out: 205 207 write_sequnlock(&net->fs_lock); 206 208 return server; 207 209 }