74b1de
From e44b75fdb86dcf759204816c873b4f9f4efbefa8 Mon Sep 17 00:00:00 2001
74b1de
From: Susant Palai <spalai@redhat.com>
74b1de
Date: Tue, 21 May 2019 16:17:09 +0530
74b1de
Subject: [PATCH 142/169] lock: check null value of dict to avoid log flooding
74b1de
74b1de
> updates: bz#1712322
74b1de
> Change-Id: I120a1d23506f9ebcf88c7ea2f2eff4978a61cf4a
74b1de
> Signed-off-by: Susant Palai <spalai@redhat.com>
74b1de
(backport of fix https://review.gluster.org/#/c/glusterfs/+/22756/)
74b1de
74b1de
BUG: bz#1704181
74b1de
Change-Id: I2a192236328ebb39666ffef1146df312c08a377d
74b1de
Signed-off-by: Susant Palai <spalai@redhat.com>
74b1de
Reviewed-on: https://code.engineering.redhat.com/gerrit/171325
74b1de
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74b1de
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
74b1de
---
74b1de
 xlators/features/locks/src/posix.c | 2 +-
74b1de
 1 file changed, 1 insertion(+), 1 deletion(-)
74b1de
74b1de
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
74b1de
index 3f1c7a7..adb0df5 100644
74b1de
--- a/xlators/features/locks/src/posix.c
74b1de
+++ b/xlators/features/locks/src/posix.c
74b1de
@@ -121,7 +121,7 @@ fetch_pathinfo(xlator_t *, inode_t *, int32_t *, char **);
74b1de
 
74b1de
 #define PL_CHECK_LOCK_ENFORCE_KEY(frame, dict, name, this, loc, fd, priv)      \
74b1de
     do {                                                                       \
74b1de
-        if (dict_get(dict, GF_ENFORCE_MANDATORY_LOCK) ||                       \
74b1de
+        if ((dict && (dict_get(dict, GF_ENFORCE_MANDATORY_LOCK))) ||           \
74b1de
             (name && (strcmp(name, GF_ENFORCE_MANDATORY_LOCK) == 0))) {        \
74b1de
             inode_t *__inode = (loc ? loc->inode : fd->inode);                 \
74b1de
             pl_inode_t *__pl_inode = pl_inode_get(this, __inode, NULL);        \
74b1de
-- 
74b1de
1.8.3.1
74b1de