diff options
author | Alexander Aring <aahringo@redhat.com> | 2022-04-04 23:06:33 +0300 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-04-06 22:02:05 +0300 |
commit | a800ba77fd285c6391a82819867ac64e9ab3af46 (patch) | |
tree | 2592028e9e2ca5e4d48e7817b791aaf19cde0793 /fs/dlm | |
parent | bcbb4ba6c9ba81e6975b642a2cade68044cd8a66 (diff) | |
download | linux-a800ba77fd285c6391a82819867ac64e9ab3af46.tar.xz |
dlm: rearrange async condition return
This patch moves the return of FILE_LOCK_DEFERRED a little bit earlier
than checking afterwards again if the request was an asynchronous request.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/plock.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 4e60dd657cb6..757d9013788a 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -149,26 +149,25 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file, op_data->file = file; op->data = op_data; + + send_op(op); + rv = FILE_LOCK_DEFERRED; + goto out; } else { op->info.owner = (__u64)(long) fl->fl_owner; } send_op(op); - if (!op->data) { - rv = wait_event_interruptible(recv_wq, (op->done != 0)); - if (rv == -ERESTARTSYS) { - log_debug(ls, "dlm_posix_lock: wait killed %llx", - (unsigned long long)number); - spin_lock(&ops_lock); - list_del(&op->list); - spin_unlock(&ops_lock); - dlm_release_plock_op(op); - do_unlock_close(ls, number, file, fl); - goto out; - } - } else { - rv = FILE_LOCK_DEFERRED; + rv = wait_event_interruptible(recv_wq, (op->done != 0)); + if (rv == -ERESTARTSYS) { + log_debug(ls, "%s: wait killed %llx", __func__, + (unsigned long long)number); + spin_lock(&ops_lock); + list_del(&op->list); + spin_unlock(&ops_lock); + dlm_release_plock_op(op); + do_unlock_close(ls, number, file, fl); goto out; } |