summaryrefslogtreecommitdiff
path: root/include/linux/dlm_plock.h
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2023-07-20 15:22:41 +0300
committerDavid Teigland <teigland@redhat.com>2023-07-21 01:25:04 +0300
commitdc52cd2eff4ac924a795efcef27f8fd58a5260bb (patch)
tree9d78febd4a8b4c4b97051c3e69edf473b4af109f /include/linux/dlm_plock.h
parent568f915655b3b4c40032104e4d0014e5e2c474b9 (diff)
downloadlinux-dc52cd2eff4ac924a795efcef27f8fd58a5260bb.tar.xz
fs: dlm: fix F_CANCELLK to cancel pending request
This patch fixes the current handling of F_CANCELLK by not just doing a unlock as we need to try to cancel a lock at first. A unlock makes sense on a non-blocking lock request but if it's a blocking lock request we need to cancel the request until it's not granted yet. This patch is fixing this behaviour by first try to cancel a lock request and if it's failed it's unlocking the lock which seems to be granted. Note: currently the nfs locking handling was disabled by commit 40595cdc93ed ("nfs: block notification on fs with its own ->lock"). However DLM was never being updated regarding to this change. Future patches will try to fix lockd lock requests for DLM. This patch is currently assuming the upstream DLM lockd handling is correct. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'include/linux/dlm_plock.h')
-rw-r--r--include/linux/dlm_plock.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dlm_plock.h b/include/linux/dlm_plock.h
index e6d76e8715a6..15fc856d198c 100644
--- a/include/linux/dlm_plock.h
+++ b/include/linux/dlm_plock.h
@@ -11,6 +11,8 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
int cmd, struct file_lock *fl);
int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
struct file_lock *fl);
+int dlm_posix_cancel(dlm_lockspace_t *lockspace, u64 number, struct file *file,
+ struct file_lock *fl);
int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
struct file_lock *fl);
#endif