kernel_optimize_test/fs/afs
David Howells ae3b7361dc afs: Fix validation/callback interaction
When afs_validate() is called to validate a vnode (inode), there are two
unhandled cases in the fastpath at the top of the function:

 (1) If the vnode is promised (AFS_VNODE_CB_PROMISED is set), the break
     counters match and the data has expired, then there's an implicit case
     in which the vnode needs revalidating.

     This has no consequences since the default "valid = false" set at the
     top of the function happens to do the right thing.

 (2) If the vnode is not promised and it hasn't been deleted
     (AFS_VNODE_DELETED is not set) then there's a default case we're not
     handling in which the vnode is invalid.  If the vnode is invalid, we
     need to bring cb_s_break and cb_v_break up to date before we refetch
     the status.

     As a consequence, once the server loses track of the client
     (ie. sufficient time has passed since we last sent it an operation),
     it will send us a CB.InitCallBackState* operation when we next try to
     talk to it.  This calls afs_init_callback_state() which increments
     afs_server::cb_s_break, but this then doesn't propagate to the
     afs_vnode record.

     The result being that every afs_validate() call thereafter sends a
     status fetch operation to the server.

Clarify and fix this by:

 (A) Setting valid in all the branches rather than initialising it at the
     top so that the compiler catches where we've missed.

 (B) Restructuring the logic in the 'promised' branch so that we set valid
     to false if the callback is due to expire (or has expired) and so that
     the final case is that the vnode is still valid.

 (C) Adding an else-statement that ups cb_s_break and cb_v_break if the
     promised and deleted cases don't match.

Fixes: c435ee3455 ("afs: Overhaul the callback handling")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2018-11-29 21:08:14 -05:00
..
addr_list.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
afs_cm.h
afs_fs.h afs: Prospectively look up extra files when doing a single lookup 2018-04-09 21:12:31 +01:00
afs_vl.h afs: Make use of the YFS service upgrade to fully support IPv6 2017-11-13 15:38:19 +00:00
afs.h afs: Expand data structure fields to support YFS 2018-10-24 00:41:08 +01:00
cache.c afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS 2018-10-24 00:41:08 +01:00
callback.c afs: Implement YFS support in the fs client 2018-10-24 00:41:08 +01:00
cell.c afs: Fix TTL on VL server and address lists 2018-10-24 00:41:07 +01:00
cmservice.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +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: Implement YFS support in the fs client 2018-10-24 00:41:08 +01:00
dynroot.c afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS 2018-10-24 00:41:08 +01:00
file.c afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS 2018-10-24 00:41:08 +01:00
flock.c afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS 2018-10-24 00:41:08 +01:00
fs_probe.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
fsclient.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
inode.c afs: Fix validation/callback interaction 2018-11-29 21:08:14 -05:00
internal.h afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
Kconfig afs: Allow dumping of server cursor on operation failure 2018-10-24 00:41:09 +01:00
main.c afs: Fix cell proc list 2018-10-12 13:18:57 +02:00
Makefile afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
misc.c
mntpt.c afs: Add a couple of tracepoints to log I/O errors 2018-10-24 00:41:07 +01:00
netdevices.c afs: Implement network namespacing 2018-05-23 12:01:15 +01:00
proc.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
protocol_yfs.h afs: Implement YFS support in the fs client 2018-10-24 00:41:08 +01:00
rotate.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
rxrpc.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
security.c afs: Fix callback handling 2018-10-24 00:41:09 +01:00
server_list.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
server.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
super.c afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS 2018-10-24 00:41:08 +01:00
vl_list.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
vl_probe.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
vl_rotate.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
vlclient.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
volume.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
write.c afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS 2018-10-24 00:41:08 +01:00
xattr.c afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS 2018-10-24 00:41:08 +01:00
xdr_fs.h afs: Adjust the directory XDR structures 2018-04-09 21:54:48 +01:00
yfsclient.c afs: Fix callback handling 2018-10-24 00:41:09 +01:00