Commit a800ba77 authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland

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: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent bcbb4ba6
...@@ -149,26 +149,25 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file, ...@@ -149,26 +149,25 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
op_data->file = file; op_data->file = file;
op->data = op_data; op->data = op_data;
send_op(op);
rv = FILE_LOCK_DEFERRED;
goto out;
} else { } else {
op->info.owner = (__u64)(long) fl->fl_owner; op->info.owner = (__u64)(long) fl->fl_owner;
} }
send_op(op); send_op(op);
if (!op->data) { rv = wait_event_interruptible(recv_wq, (op->done != 0));
rv = wait_event_interruptible(recv_wq, (op->done != 0)); if (rv == -ERESTARTSYS) {
if (rv == -ERESTARTSYS) { log_debug(ls, "%s: wait killed %llx", __func__,
log_debug(ls, "dlm_posix_lock: wait killed %llx", (unsigned long long)number);
(unsigned long long)number); spin_lock(&ops_lock);
spin_lock(&ops_lock); list_del(&op->list);
list_del(&op->list); spin_unlock(&ops_lock);
spin_unlock(&ops_lock); dlm_release_plock_op(op);
dlm_release_plock_op(op); do_unlock_close(ls, number, file, fl);
do_unlock_close(ls, number, file, fl);
goto out;
}
} else {
rv = FILE_LOCK_DEFERRED;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment