fs: dlm: interrupt posix locks only when process is killed
authorAlexander Aring <aahringo@redhat.com>
Fri, 19 May 2023 15:21:26 +0000 (11:21 -0400)
committerDavid Teigland <teigland@redhat.com>
Mon, 22 May 2023 19:34:32 +0000 (14:34 -0500)
If a posix lock request is waiting for a result from user space
(dlm_controld), do not let it be interrupted unless the process
is killed. This reverts commit a6b1533e9a57 ("dlm: make posix locks
interruptible"). The problem with the interruptible change is
that all locks were cleared on any signal interrupt. If a signal
was received that did not terminate the process, the process
could continue running after all its dlm posix locks had been
cleared. A future patch will add cancelation to allow proper
interruption.

Cc: stable@vger.kernel.org
Fixes: a6b1533e9a57 ("dlm: make posix locks interruptible")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/plock.c

index fea2157fac5b9af744896d2f579328f4634cb7f9..31bc601ee3d8d6beb7d0231a9c3276e0351c500c 100644 (file)
@@ -155,7 +155,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
 
        send_op(op);
 
-       rv = wait_event_interruptible(recv_wq, (op->done != 0));
+       rv = wait_event_killable(recv_wq, (op->done != 0));
        if (rv == -ERESTARTSYS) {
                spin_lock(&ops_lock);
                /* recheck under ops_lock if we got a done != 0,