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

fs: dlm: make F_SETLK use unkillable wait_event



While a non-waiting posix lock request (F_SETLK) is waiting for
user space processing (in dlm_controld), wait for that processing
to complete with an unkillable wait_event(). This makes F_SETLK
behave the same way for F_RDLCK, F_WRLCK and F_UNLCK. F_SETLKW
continues to use wait_event_killable().

Cc: stable@vger.kernel.org
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 59e45c75
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,

	send_op(op);

	if (op->info.wait) {
		rv = wait_event_killable(recv_wq, (op->done != 0));
		if (rv == -ERESTARTSYS) {
			spin_lock(&ops_lock);
@@ -175,6 +176,9 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
			dlm_release_plock_op(op);
			goto out;
		}
	} else {
		wait_event(recv_wq, (op->done != 0));
	}

do_lock_wait: