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

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
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -149,16 +149,19 @@ 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",
		log_debug(ls, "%s: wait killed %llx", __func__,
			  (unsigned long long)number);
		spin_lock(&ops_lock);
		list_del(&op->list);
@@ -167,10 +170,6 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
		do_unlock_close(ls, number, file, fl);
		goto out;
	}
	} else {
		rv = FILE_LOCK_DEFERRED;
		goto out;
	}

	WARN_ON(!list_empty(&op->list));