fs: dlm: add missing spin_unlock
authorAlexander Aring <aahringo@redhat.com>
Tue, 1 Aug 2023 18:09:38 +0000 (14:09 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 10 Aug 2023 15:33:03 +0000 (10:33 -0500)
This patch fixes commit dc52cd2eff4a ("fs: dlm: fix F_CANCELLK to cancel
pending request") that we don't unlock the ops_lock in a rate case when
a waiter cannot be found. This case can only happen when cancellation of
plock operation was successful but no kernel waiter was being found.

Fixes: dc52cd2eff4a ("fs: dlm: fix F_CANCELLK to cancel pending request")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/plock.c

index 943d9f8e55645b12bf48c23dbcbc9855c73e7f1b..44b3aab5b709bf8aeab680e07f50b9806c88b51b 100644 (file)
@@ -398,6 +398,7 @@ int dlm_posix_cancel(dlm_lockspace_t *lockspace, u64 number, struct file *file,
                 */
                op = plock_lookup_waiter(&info);
                if (WARN_ON_ONCE(!op)) {
+                       spin_unlock(&ops_lock);
                        rv = -ENOLCK;
                        break;
                }