Skip to content

Commit a800ba7

Browse files
Alexander Aringteigland
authored andcommitted
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>
1 parent bcbb4ba commit a800ba7

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

fs/dlm/plock.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,25 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
149149
op_data->file = file;
150150

151151
op->data = op_data;
152+
153+
send_op(op);
154+
rv = FILE_LOCK_DEFERRED;
155+
goto out;
152156
} else {
153157
op->info.owner = (__u64)(long) fl->fl_owner;
154158
}
155159

156160
send_op(op);
157161

158-
if (!op->data) {
159-
rv = wait_event_interruptible(recv_wq, (op->done != 0));
160-
if (rv == -ERESTARTSYS) {
161-
log_debug(ls, "dlm_posix_lock: wait killed %llx",
162-
(unsigned long long)number);
163-
spin_lock(&ops_lock);
164-
list_del(&op->list);
165-
spin_unlock(&ops_lock);
166-
dlm_release_plock_op(op);
167-
do_unlock_close(ls, number, file, fl);
168-
goto out;
169-
}
170-
} else {
171-
rv = FILE_LOCK_DEFERRED;
162+
rv = wait_event_interruptible(recv_wq, (op->done != 0));
163+
if (rv == -ERESTARTSYS) {
164+
log_debug(ls, "%s: wait killed %llx", __func__,
165+
(unsigned long long)number);
166+
spin_lock(&ops_lock);
167+
list_del(&op->list);
168+
spin_unlock(&ops_lock);
169+
dlm_release_plock_op(op);
170+
do_unlock_close(ls, number, file, fl);
172171
goto out;
173172
}
174173

0 commit comments

Comments
 (0)