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