OpenCloudOS-Kernel/fs/afs
David Howells 4be5975aea afs: Further fix file locking
Further fix the file locking in the afs filesystem client in a number of
ways, including:

 (1) Don't submit the operation to obtain a lock from the server in a work
     queue context, but rather do it in the process context of whoever
     issued the requesting system call.

 (2) The owner of the file_lock struct at the front of the pending_locks
     queue now owns right to talk to the server.

 (3) Write locks can be instantly granted if they don't overlap with any
     other locks *and* we have a write lock on the server.

 (4) In the event of an authentication/permission error, all other matching
     pending locks requests are also immediately aborted.

 (5) Properly use VFS core locks_lock_file_wait() to distribute the server
     lock amongst local client locks, including waiting for the lock to
     become available.

Test with:

	sqlite3 /afs/.../scratch/billings.sqlite <<EOF
	CREATE TABLE hosts (
	    hostname varchar(80),
	    shorthost varchar(80),
	    room varchar(30),
	    building varchar(30),
	    PRIMARY KEY(shorthost)
	    );
	EOF

With the version of sqlite3 that I have, this should fail consistently with
EAGAIN, whether or not the program is straced (which introduces some delays
between lock syscalls).

Fixes: 0fafdc9f88 ("afs: Fix file locking")
Reported-by: Jonathan Billings <jsbillin@umich.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
2019-04-25 14:26:50 +01:00
..
Kconfig afs: Allow dumping of server cursor on operation failure 2018-10-24 00:41:09 +01:00
Makefile afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
addr_list.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
afs.h afs: Expand data structure fields to support YFS 2018-10-24 00:41:08 +01:00
afs_cm.h afs: support the CB.ProbeUuid RPC op 2008-04-29 08:06:26 -07:00
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
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: Fix in-progess ops to ignore server-level callback invalidation 2019-04-13 08:37:37 +01:00
cell.c afs: Fix manually set volume location server list 2019-02-25 11:59:07 -08:00
cmservice.c afs: Avoid section confusion in CM_NAME 2019-04-13 08:37:36 +01:00
dir.c afs: Use d_instantiate() rather than d_add() and don't d_drop() 2018-11-29 21:08:14 -05:00
dir_edit.c afs: Locally edit directory data for mkdir/create/unlink/... 2018-04-09 21:54:48 +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 fs: don't open code lru_to_page() 2019-01-04 13:13:48 -08:00
flock.c afs: Further fix file locking 2019-04-25 14:26:50 +01:00
fs_probe.c afs: Split wait from afs_make_call() 2019-04-25 14:26:50 +01:00
fsclient.c afs: Calculate lock extend timer from set/extend reply reception 2019-04-25 14:26:50 +01:00
inode.c afs: avoid deprecated get_seconds() 2019-04-13 08:37:36 +01:00
internal.h afs: Calculate lock extend timer from set/extend reply reception 2019-04-25 14:26:50 +01:00
main.c afs: Fix cell proc list 2018-10-12 13:18:57 +02:00
misc.c afs: Fix missing net error handling 2018-11-29 21:08:14 -05:00
mntpt.c afs: Use fs_context to pass parameters over automount 2019-02-28 03:29:39 -05: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: Set correct lock type for the yfs CreateFile 2019-01-10 17:12:05 +00:00
rotate.c afs: Fix missing net error handling 2018-11-29 21:08:14 -05:00
rxrpc.c afs: Split wait from afs_make_call() 2019-04-25 14:26:50 +01:00
security.c afs: Fix callback handling 2018-10-24 00:41:09 +01:00
server.c afs: Fix in-progess ops to ignore server-level callback invalidation 2019-04-13 08:37:37 +01:00
server_list.c afs: Use struct_size() in kzalloc() 2019-01-10 17:12:05 +00:00
super.c Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-03-12 14:08:19 -07:00
vl_list.c afs: Probe multiple fileservers simultaneously 2018-10-24 00:41:09 +01:00
vl_probe.c afs: Split wait from afs_make_call() 2019-04-25 14:26:50 +01:00
vl_rotate.c afs: Fix missing net error handling 2018-11-29 21:08:14 -05:00
vlclient.c afs: Split wait from afs_make_call() 2019-04-25 14:26:50 +01:00
volume.c afs: Add fs_context support 2019-02-28 03:29:38 -05:00
write.c afs: Unlock pages for __pagevec_release() 2019-04-13 08:37:37 +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: Calculate lock extend timer from set/extend reply reception 2019-04-25 14:26:50 +01:00