dlm: use FL_SLEEP to determine blocking vs non-blocking
authorAlexander Aring <aahringo@redhat.com>
Mon, 13 Nov 2023 21:24:10 +0000 (16:24 -0500)
committerDavid Teigland <teigland@redhat.com>
Thu, 16 Nov 2023 17:59:19 +0000 (11:59 -0600)
This patch uses the FL_SLEEP flag in struct file_lock to determine if
the lock request is a blocking or non-blocking request. Before dlm was
using IS_SETLKW() was being used which is not usable for lock requests
coming from lockd when EXPORT_OP_SAFE_ASYNC_LOCK inside the export flags
is set.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/plock.c

index ee6e0236d4f858f94cfe17a5dc5cb3ee049603b2..d814c51213670bb8897701e30c01dc5b78ab6af9 100644 (file)
@@ -140,7 +140,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
        op->info.optype         = DLM_PLOCK_OP_LOCK;
        op->info.pid            = fl->fl_pid;
        op->info.ex             = (fl->fl_type == F_WRLCK);
-       op->info.wait           = IS_SETLKW(cmd);
+       op->info.wait           = !!(fl->fl_flags & FL_SLEEP);
        op->info.fsid           = ls->ls_global_id;
        op->info.number         = number;
        op->info.start          = fl->fl_start;