X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=fs%2Focfs2%2Fdlmglue.c;h=956edf67be20ba6b1711f6aa4c915aad9cead0a7;hb=2f2eca20a09dac0e9d62bf57ce6a0c6ef6cf91e6;hp=11849a44dc5a90d7a9a0b7eb389d928a7e9345a7;hpb=e1b63dec2ddba654c7ca75996284e453f32d1af7;p=mirror_ubuntu-bionic-kernel.git diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 11849a44dc5a..956edf67be20 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -1391,6 +1391,11 @@ static int __ocfs2_cluster_lock(struct ocfs2_super *osb, int noqueue_attempted = 0; int dlm_locked = 0; + if (!(lockres->l_flags & OCFS2_LOCK_INITIALIZED)) { + mlog_errno(-EINVAL); + return -EINVAL; + } + ocfs2_init_mask_waiter(&mw); if (lockres->l_ops->flags & LOCK_TYPE_USES_LVB) @@ -2954,7 +2959,7 @@ static int ocfs2_dlm_init_debug(struct ocfs2_super *osb) osb->osb_debug_root, osb, &ocfs2_dlm_debug_fops); - if (!dlm_debug->d_locking_state) { + if (IS_ERR_OR_NULL(dlm_debug->d_locking_state)) { ret = -EINVAL; mlog(ML_ERROR, "Unable to create locking state debugfs file.\n");