afs: Wait for outstanding async calls before closing rxrpc socket
authorDavid Howells <dhowells@redhat.com>
Thu, 7 Apr 2016 16:23:03 +0000 (17:23 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Apr 2016 19:34:40 +0000 (15:34 -0400)
commit2f02f7aea7b6c9a9312846c006e076ae6ad026a4
tree5afe9c2ab7c1c0c56ea17cd72bd5895232aae07f
parentc64a73d584cc344915baee1183c791c0d0c42d79
afs: Wait for outstanding async calls before closing rxrpc socket

The afs filesystem needs to wait for any outstanding asynchronous calls
(such as FS.GiveUpCallBacks cleaning up the callbacks lodged with a server)
to complete before closing the AF_RXRPC socket when unloading the module.

This may occur if the module is removed too quickly after unmounting all
filesystems.  This will produce an error report that looks like:

AFS: Assertion failed
1 == 0 is false
0x1 == 0x0 is false
------------[ cut here ]------------
kernel BUG at ../fs/afs/rxrpc.c:135!
...
RIP: 0010:[<ffffffffa004111c>] afs_close_socket+0xec/0x107 [kafs]
...
Call Trace:
 [<ffffffffa004a160>] afs_exit+0x1f/0x57 [kafs]
 [<ffffffff810c30a0>] SyS_delete_module+0xec/0x17d
 [<ffffffff81610417>] entry_SYSCALL_64_fastpath+0x12/0x6b

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
fs/afs/rxrpc.c