From cdfb26b40dfa51127d22d171cef4fe8993cbfb55 Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 25 Apr 2019 14:26:51 +0100 Subject: 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 Signed-off-by: David Howells --- include/trace/events/afs.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/trace') diff --git a/include/trace/events/afs.h b/include/trace/events/afs.h index 24c058a93e8f..21b896fabb2f 100644 --- a/include/trace/events/afs.h +++ b/include/trace/events/afs.h @@ -156,9 +156,11 @@ enum afs_flock_event { afs_flock_acquired, afs_flock_callback_break, afs_flock_defer_unlock, + afs_flock_extend_fail, afs_flock_fail_other, afs_flock_fail_perm, afs_flock_no_lockers, + afs_flock_release_fail, afs_flock_timestamp, afs_flock_try_to_lock, afs_flock_vfs_lock, @@ -323,15 +325,18 @@ enum afs_flock_operation { EM(AFS_VNODE_LOCK_GRANTED, "GRANTED") \ EM(AFS_VNODE_LOCK_EXTENDING, "EXTENDING") \ EM(AFS_VNODE_LOCK_NEED_UNLOCK, "NEED_UNLOCK") \ - E_(AFS_VNODE_LOCK_UNLOCKING, "UNLOCKING") \ + EM(AFS_VNODE_LOCK_UNLOCKING, "UNLOCKING") \ + E_(AFS_VNODE_LOCK_DELETED, "DELETED") #define afs_flock_events \ EM(afs_flock_acquired, "Acquired") \ EM(afs_flock_callback_break, "Callback") \ EM(afs_flock_defer_unlock, "D-Unlock") \ + EM(afs_flock_extend_fail, "Ext_Fail") \ EM(afs_flock_fail_other, "ErrOther") \ EM(afs_flock_fail_perm, "ErrPerm ") \ EM(afs_flock_no_lockers, "NoLocker") \ + EM(afs_flock_release_fail, "Rel_Fail") \ EM(afs_flock_timestamp, "Timestmp") \ EM(afs_flock_try_to_lock, "TryToLck") \ EM(afs_flock_vfs_lock, "VFSLock ") \ -- cgit v1.2.3-58-ga151