kernel_optimize_test/fs/afs
David Howells 660625922b afs: Fix server record deletion
AFS server records get removed from the net->fs_servers tree when
they're deleted, but not from the net->fs_addresses{4,6} lists, which
can lead to an oops in afs_find_server() when a server record has been
removed, for instance during rmmod.

Fix this by deleting the record from the by-address lists before posting
it for RCU destruction.

The reason this hasn't been noticed before is that the fileserver keeps
probing the local cache manager, thereby keeping the service record
alive, so the oops would only happen when a fileserver eventually gets
bored and stops pinging or if the module gets rmmod'd and a call comes
in from the fileserver during the window between the server records
being destroyed and the socket being closed.

The oops looks something like:

  BUG: unable to handle kernel NULL pointer dereference at 000000000000001c
  ...
  Workqueue: kafsd afs_process_async_call [kafs]
  RIP: 0010:afs_find_server+0x271/0x36f [kafs]
  ...
  Call Trace:
   afs_deliver_cb_init_call_back_state3+0x1f2/0x21f [kafs]
   afs_deliver_to_call+0x1ee/0x5e8 [kafs]
   afs_process_async_call+0x5b/0xd0 [kafs]
   process_one_work+0x2c2/0x504
   worker_thread+0x1d4/0x2ac
   kthread+0x11f/0x127
   ret_from_fork+0x24/0x30

Fixes: d2ddc776a4 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-20 09:59:33 -07:00
..
addr_list.c
afs_cm.h
afs_fs.h
afs_vl.h
afs.h afs: Rearrange status mapping 2018-04-09 21:53:59 +01:00
cache.c
callback.c afs: Do better accretion of small writes on newly created content 2018-04-09 21:54:48 +01:00
cell.c
cmservice.c afs: Trace protocol errors 2018-04-09 21:54:48 +01:00
dir_edit.c afs: Locally edit directory data for mkdir/create/unlink/... 2018-04-09 21:54:48 +01:00
dir.c afs: Do better accretion of small writes on newly created content 2018-04-09 21:54:48 +01:00
dynroot.c afs: Split the dynroot stuff out and give it its own ops tables 2018-04-09 21:54:00 +01:00
file.c afs: Do better accretion of small writes on newly created content 2018-04-09 21:54:48 +01:00
flock.c afs: Make it possible to get the data version in readpage 2018-04-09 21:53:56 +01:00
fsclient.c afs: Trace protocol errors 2018-04-09 21:54:48 +01:00
inode.c afs: Trace protocol errors 2018-04-09 21:54:48 +01:00
internal.h afs: Do better accretion of small writes on newly created content 2018-04-09 21:54:48 +01:00
Kconfig
main.c
Makefile afs: Locally edit directory data for mkdir/create/unlink/... 2018-04-09 21:54:48 +01:00
misc.c
mntpt.c
netdevices.c
proc.c afs: Add stats for data transfer operations 2018-04-09 21:54:48 +01:00
rotate.c
rxrpc.c afs: Trace protocol errors 2018-04-09 21:54:48 +01:00
security.c afs: Make it possible to get the data version in readpage 2018-04-09 21:53:56 +01:00
server_list.c
server.c afs: Fix server record deletion 2018-04-20 09:59:33 -07:00
super.c afs: Split the dynroot stuff out and give it its own ops tables 2018-04-09 21:54:00 +01:00
vlclient.c afs: Trace protocol errors 2018-04-09 21:54:48 +01:00
volume.c
write.c Merge branch 'afs-dh' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-04-12 11:59:06 -07:00
xattr.c
xdr_fs.h afs: Adjust the directory XDR structures 2018-04-09 21:54:48 +01:00