afs: Handle lock rpc ops failing on a file that got deleted
authorDavid Howells <dhowells@redhat.com>
Thu, 25 Apr 2019 13:26:51 +0000 (14:26 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 25 Apr 2019 13:26:51 +0000 (14:26 +0100)
commitcdfb26b40dfa51127d22d171cef4fe8993cbfb55
treef113dc931a8677a31d9aa70e50953a2a08357cd3
parent445b10289f766b73527ecb4fb4e388677ad93740
afs: Handle lock rpc ops failing on a file that got deleted

Holding a file lock on an AFS file does not prevent it from being deleted
on the server, so we need to handle an error resulting from that when we
try setting, extending or releasing a lock.

Fix this by adding a "deleted" lock state and cancelling the lock extension
process for that file and aborting all waiters for the lock.

Fixes: 0fafdc9f888b ("afs: Fix file locking")
Reported-by: Jonathan Billings <jsbillin@umich.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/flock.c
fs/afs/internal.h
include/trace/events/afs.h