e7a346
From 1eb5f1a725cc9afdd7b1a7b29cf446b9c60974c6 Mon Sep 17 00:00:00 2001
e7a346
From: Mohit Agrawal <moagrawa@redhat.com>
e7a346
Date: Tue, 8 May 2018 14:52:04 +0530
e7a346
Subject: [PATCH 260/260] dht: Avoid dict log flooding for internal MDS xattr
e7a346
e7a346
Problem: Before populate MDS internal xattr first dht checks if MDS is
e7a346
         present in xattr or not.If xattr dictionary is NULL dict_get
e7a346
         log the message either dict or key is NULL
e7a346
e7a346
Solution: Before call dict_get check xattr, if it is NULL then no
e7a346
          need to call dict_get.
e7a346
e7a346
> BUG: 1575910
e7a346
> Change-Id: I81604ec5945b85eba14b42f4583d06ec713028f4
e7a346
> fixes: bz#1575910
e7a346
> (cherry picked from commit ed5a09e4aea7f64f9a43698955e24285a936f0c0)
e7a346
> (Upstream link https://review.gluster.org/#/c/19981/)
e7a346
e7a346
BUG: 1575895
e7a346
Change-Id: I728a8068786f94d3793a91cdd5c64f813d7545ca
e7a346
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/138205
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e7a346
---
e7a346
 xlators/cluster/dht/src/dht-common.c | 2 +-
e7a346
 1 file changed, 1 insertion(+), 1 deletion(-)
e7a346
e7a346
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
e7a346
index 3b8ba6d..a985481 100644
e7a346
--- a/xlators/cluster/dht/src/dht-common.c
e7a346
+++ b/xlators/cluster/dht/src/dht-common.c
e7a346
@@ -855,7 +855,7 @@ dht_common_mark_mdsxattr (call_frame_t *frame, int *errst, int mark_during_fresh
e7a346
            and wind a setxattr call on hashed subvol to update
e7a346
            internal xattr
e7a346
         */
e7a346
-        if (!dict_get (local->xattr, conf->mds_xattr_key)) {
e7a346
+        if (!local->xattr || !dict_get (local->xattr, conf->mds_xattr_key)) {
e7a346
                 /* It means no internal MDS xattr has been set yet
e7a346
                 */
e7a346
                 /* Check the status of all subvol are up while call
e7a346
-- 
e7a346
1.8.3.1
e7a346