AFS fixes and other bits
Hi Linus,
Here's a set of fixes and other bits for AFS to improve the life of desktop applications such as firefox. It makes the following improvements/fixes:
(1) Fix file locking to allow fine-grained locking, as required by firefox and sqlite, with the caveat that you can't get a partial write lock on a file if you first get a partial read lock on it as the AFS protocol only supports whole-file locks.
[At some point I need to look at how best to emulate OpenAFS's behaviour whereby all partial locks are just granted without reference to the kernel lock - maybe with some sort of mount parameter to enable it.]
(2) Fix the way the server lock, once obtained, is distributed to the local processes waiting for it, thereby making sure they wait if they can't be immediately granted a local lock.
(3) Fix the nonappearance of afs locks in /proc/locks.
(4) Fix the handling of asynchronous file lock RPC operation failure on files that get deleted whilst the lock is being extended or released.
(5) Implement silly-rename.
(6) Fix the file lock expiry calculation to be based on the time the set- or extend-lock reply is seen (packet timestamp) rather than by the time at which we've done processing the operation (wallclock time) to allow for delays in processing.
(7) Split the synchronous wait out of the client call dispatcher to make it possible to convert synchronous calls into async calls in the event of a signal.
The series also:
(1) Adds/modifies a number of tracepoints, mostly related to file locking and silly rename.
(2) Provides a more comprehensive data dump in the event that a directory content check fails.
David
---
The following changes since commit ebc551f2b8f905eca0e25c476c1e5c098cd92103:
Merge tag 'nfsd-5.1' of git://linux-nfs.org/~bfields/linux (2019-03-12 15:06:54 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/afs-fixes-20190315
for you to fetch changes up to 78cf74c367eb608e8a15167da5aeae2c8abed902:
afs: Add more tracepoints (2019-03-15 22:06:31 +0000)
----------------------------------------------------------------
AFS fixes
----------------------------------------------------------------
David Howells (10):
afs: Split wait from afs_make_call()
afs: Calculate lock extend timer from set/extend reply reception
afs: Fix AFS file locking to allow fine grained locks
afs: Further fix file locking
afs: Add file locking tracepoints
afs: Improve dir check failure reports
afs: Handle lock rpc ops failing on a file that got deleted
afs: Add directory reload tracepoint
afs: Implement sillyrename for unlink and rename
afs: Add more tracepoints
fs/afs/Makefile | 1 + fs/afs/dir.c | 161 +++++++++++-- fs/afs/dir_silly.c | 239 +++++++++++++++++++ fs/afs/flock.c | 569 +++++++++++++++++++++++++++------------------ fs/afs/fs_probe.c | 13 +- fs/afs/fsclient.c | 92 +++++--- fs/afs/inode.c | 2 + fs/afs/internal.h | 25 +- fs/afs/rxrpc.c | 33 ++- fs/afs/super.c | 5 +- fs/afs/vl_probe.c | 14 +- fs/afs/vlclient.c | 26 ++- fs/afs/yfsclient.c | 72 ++++-- include/linux/fs.h | 1 + include/trace/events/afs.h | 348 ++++++++++++++++++++++++++- 15 files changed, 1258 insertions(+), 343 deletions(-) create mode 100644 fs/afs/dir_silly.c
Quoted 3 lines · David Howells
Here's a set of fixes and other bits for AFS to improve the life of desktop applications such as firefox.
I pulled, and immediately unpulled.
The thing hasn't even seen a compiler, and when you *do* show the code to a compiler, said compiler correctly warns about afs_do_silly_unlink() potentially returning an uninitialized variable.
And yes, it's _trivially_ and obviously uninitialized.
Feel free to submit this for 5.2 after it has actually seen testing. But this late in the 5.1 merge window, I'm no longer interested in totally untested new crap. It clearly wasn't ready before the merge window, and it clearly isn't ready *now*.
Much too late to try to fix this up,
Linus
Quoted 2 lines · Linus Torvalds
The thing hasn't even seen a compiler, and when you *do* show the code to a compiler, said compiler correctly warns about
No, it doesn't - at least not gcc-8.3.1 on Fedora 29. What compiler are you using?
Quoted 1 line
afs_do_silly_unlink()potentially returning an uninitialized variable.
Not only has it seen a compiler, it's also been tested numerous times, with firefox, sqlite and some commands that tests file locking manually.
But please hold off for now. I've just tried the system flock program - and that causes a lock leakage message for some reason that needs investigating.
David