mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
dlm: rearrange async condition return
[ Upstream commita800ba77fd
] 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> Stable-dep-of:59e45c758c
("fs: dlm: interrupt posix locks only when process is killed") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c07c14b4dd
commit
66cf508de1
1 changed files with 13 additions and 14 deletions
|
@ -152,26 +152,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue